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
35
UltraGrid Need to keep row open
posted

Hi,

We are using UltraGrid in our application. When I click on the "+" to open a row, I would like to remember the state and keep it open even when the grid is refreshed.

Any help would be appreciated

Thanks,

Tim

  • 34430
    Offline posted

    Hello Tim,

    I believe what is likely happening here is that when you "refresh" the UltraGrid, it is redrawing each of the rows in the state that they start out in. As such, they will be collapsed, and this is expected. There currently does not exist a setting where the rows will remain open, but I do have a recommendation for you on this matter.

    I would recommend that you handle the AfterRowExpanded and AfterRowCollapsed events of the UltraGrid in this case, which will allow you to determine which rows have actually expanded or collapsed. From the event arguments of this event's handler, you can get the UltraGridRow. Rather than caching the actual row, as the refresh will cause new instances to be placed in the grid, I would recommend caching the underlying data item to this UltraGridRow that you wish to be expanded - assuming this is not changing as well. You can get this data item by utilizing the ListObject property of the UltraGridRow.

    After your refresh happens, you can then loop through the Rows collection of the UltraGrid check the underlying ListObject property for your cached, "expanded" data items. If the items match, you can mark the Expanded property of your UltraGridRow as true.

    Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer