child objects data in datagridview

Feb 21, 2009 at 10:59 AM
Edited Feb 21, 2009 at 11:46 AM
First of all, I want to thank you for great framework! After testing it a bit I found it very intuitive and useful. However there are two
problems that i can not solve for weeks (and I am sure there is way to solution)

1. Problem with data presentation of Child objects in bound datagrids (nested property binding)

    I have databound grid which data is collected trough GetCusomers() method
    Customer is in relation with datatable (and entity class) CustomerAdress
    It is not problem to get
      
            Customer.ID, Customer.Name, Customer.Code

   but I also want to have column with Customer.IDAdress.Street (to have column which can get data from
   child object Adress) But it seems that it is not possible with datagridview and C1Datagridview controls
  I tried to put "Cusromer.IDAdress.Street" as datafield but it seems it does not work that way (no direct binding with child objects)
  Probabbly there is soution with unbound mode but why it is not possible to bind it automatically when this data is allready
  available when we call GetCustomers() method ?

2. Problem with sorting columns in datagridview.

 Is there simple way to sort data automatically in datagridview (when we click column header). I see that Sort method is implemented in IBindingList
 interface but how to use it for simple sorting when we bind data to datagridview control ?

3. Question/suggestion

I noticed when I have tables with many fields and that table is in relation with many other tables, then loading
records can be slow with Get method. I noticed that most time consuming part is mapping raw data into dependent
objects. Is it possible to have "light load" method so we can get data for main table, and not all dependent tables data?
For example we fill data with this light Get method, but when we need details, there is always option to get child
object via with get method on foregin keys.

Thank you in advance !
Mar 2, 2009 at 8:53 AM
Edited Mar 2, 2009 at 8:54 AM
Hi again,

I managed to solve issues #1 and #2 by combining information presented in these two great
articles:

http://www.timvw.be/presenting-the-sortablebindinglistt-take-two/
http://www.codeproject.com/KB/cs/ObjectBindingSource.aspx

regards