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
230
Expand rows just to a certain level
posted

Hi

I would like to give the users the opportunity to expand rows in a hierarchical grid to a certain level. Our grid has a depth of 6 levels. The user then chooses in combobox the level to which he wants to expand the rows and all rows which belongs to a deeper level should stay collapsed. Currently it is just possible to expand/collapse all rows of the grid. Can anybody help? Thank you!

Cheers
Dan

  • 469350
    Offline posted

    Hi Dan,

    I think you would have to loop through the rows. What you can do is use the grid.Rows.GetRowsEnumerator method. This method will give you a sort've flattened loop or rows in all bands, and you can specify the lowest level band you want.

    Setting the Expanded state on a lot of individual rows might be a performance hit, though. So I recommend that you check out the WinGrid Performance Guide and check out the section on BeginUpdate / EndUpdate.