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
195
Grid not displaying bands intermittently
posted

I have a hierachical data source (object data source..not dataset) that I have bound a win grid to.  Unfortunately when I expand a band I intermittently get the link lines displaying the number of rows in the band  (indicating that the data is in the datasource and grid seems to know about it) but the actual band and data is not displayed.   Other bands expand fine.

e.g.

[band 0]

band0row0

band0row1

      |_[band 1]

       band1row0

       band1row1

          |_[band2]row0 (not displayed but link lines on left are displayed)

          |_[band2]row1(not displayed but link lines on left are displayed)

The band has not been set to be hidden.  I have even tried to rebind the grid after the row expanded event but this doesn't help.

Version 7.2 of wingrid.

 Any ideas?

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

     If I understand you correctly, it sounds like you are getting rows with no columns. If that's the case, it's most likely because your data structure is no homogenous. 

    It's hard to say without knowing how your data object is being implemented, but the grid can only be bound to a homogenous data source. In other words, all the rows at a particular level must have the same structure. To put it another way, you can't have rows of different types under different parents in the same level of the hierarchy.

     Also, it may be that the grid is unable to get the data structure of the columns at a particular level. The BindingManager in DotNet can't get the structure of a child level if the first row of data does not return a typed object for that list. For example, if you are binding your grid to a List or BindingList of objects and those objects return a property that is of type List or BindingList, you must make sure that the first root-level object returns a child list, even if that list is empty. It can't return null, because then the BindingManager can't get the structure of the children because it won't know what type the objects are. The same applies to each level down. So if your first parent row happens to return an empty list, then the BindingManager will be unable to get the structure of the grandchild rows, since there are no child rows for which to get a grandchild row. 

Children