Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
755
Multiple childbands as main row
posted

Hello,

I have a question about the ultragrid. Is it possible to define the grid on one of it's 10.000 properties somewhere so it acts like the following example

As example i have this class

Class exampleClassExample

Currently

  • 1 row (person)
  • 2 child bands with 1 differend adres foreach adres in the list

This has a drawback that i can't filter or sort on the grid when i have for example 3000 persons. Ofcourse i can create a new object and convert 1 object into the other object.. but that's a workaround, i don't want to redefine it every time. Just because i want to filter or sort on a specific adres.

Greetings

Parents
No Data
Reply
  • 469350
    Offline posted

    The BindingManager considers an object to be a list if it implements IList or IBindingList.

     So if you want to bind the grid such that the root level rows are Person objects, then you need to bind the grid to a List of people. I recommend using the BindingList<Person> type. 

    In order for the child rows to work, the Person class would have to return a List of Adresses, not an array. It would also have to be returned as a Public Property, not just a member. If you are using VS2005 or higher, I recommend changing the type of the Adresses to BindingList<Adres>.

Children