Any ideas of how to architect a win navigation grid where it will refresh a parent/child based on the id selected by the user?

Any ideas of how to architect a win navigation grid where it will refresh a parent/child based on the id selected by the user?

Old forum URL: forums.lhotka.net/forums/t/2085.aspx


GeorgeG posted on Friday, January 05, 2007

I am going to start using the CSLA and looking for input of how to implement this architecture using a single windows form. This is what I would like to do. Take for example a simple parent child (Invoice, InvoiceItems) example. Would like to use one Invoice form where at the top there will be different search criteria ie start end date, invoice number and so on. There will be also a command button called search. The user will enter search criteria and then click search. Let me design first the sceen to make it easier

-----  ------       ------     [Search]

Nav Grid                              Invoice Business object

--- ---                                    ----  -----        ----       ----- 

--- ---                                  Invoice Items Grid

--- ---                                   --- --- ---- ----

--- ---                                  --- --- ---- ---

 I would like to take the search return business object(will only have few attributes InvoiceNum,Date,$) and attatch it a navigation datagridview(not updated by user but updated by the savecode). The user can click on any line on the nav grid and the text boxes of the Invoice and InvoiceItemsGrid will be refreshed by going to the db and getting an Invoice object and InvoiceItems business object based the invoice num on the selected invoice num coming from the nav grid. Would like when a user adds,updates or deletes anything, to have the navigation business objected to be updated and refreshed accordingly only on the screen. For example, if a user adds an invoice that invoice will also be added to the nav business object. If a user adds more items to the existing selected row, the nav grid would be updated to have the right amount.

Any ideas of how to implement the navigation business object?

Thanks

 

Inquistive_Mind replied on Monday, January 08, 2007

Im working on something similar to this and would like a Hierarchial Display.Right now I have a Editable Root BO,Editable Child BO and a Editable Child Collection BO.PLease let me know if you firgure out binding it to the datagrid and editing the objects.If I can figure it out then I'll post the solution.

Thanks,

V

Brian Criswell replied on Monday, January 08, 2007

My first suggestion would be to just load the navigation list again.  Unless this is a list of tens of thousands of objects, you will probably find the performance to be acceptable.

GeorgeG replied on Monday, January 08, 2007

The data is not even in the thousand. I am thinking

  1. Load the nav cursor again when the user calls the save code sucessfully in the win front end.
  2. Not have the nav object altogether per se but have an editable not child BusinessListBase so the user can navigate and also update the text boxes attached to it. Certain columns will be attached to a datagridview and most of the the columns(ones to show to user) attached to text boxes.

The 1st one should be faster and lighter but need to worry about synchronization code(where the user was left) and may sorting. The latter will probably take longer for savecode to return if you have a lot of rows but less code.

 

Brian Criswell replied on Tuesday, January 09, 2007

Take a look at #1 then.  Look at the ObjectListView or SortedBindingList for sorting, and look at IBindingList.Find (which both of those implement) to get the index of the item to highlight in the UI to show where the user was.

GeorgeG replied on Tuesday, January 09, 2007

That should do it. Thanks

Copyright (c) Marimer LLC