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
220
How to update child rows collections in virtual mode?
posted

I have an UltraGrid bound to an UltraDataSource to show hierarchical data.
The UltraDataSource is in virtual mode.
I'm using the InitializeRowsCollection event to populate the child rows, and the CellDataRequested event to provide the data.
When my data have been changed, I want to update the appropriate rows in the grid, without re-loading the complete grid.
As long as root level rows need to be updated, I add or remove rows, or I reset the cached values.
Now I'm struggling with updating child rows.  What I want to achieve is to update a root level row and all its child rows, including increasing/decreasing the number of child rows.
My idea was, to force the UltraDataSource.InitializeRowsCollection event for the child row collections of the specific root level row.
But how can I force the event to be fired?

Thanks

Enrico

 

  • 469350
    Verified Answer
    Offline posted

    I think you reset the child row data in the same way you reset the parent data. The only tricky part is that the child rows are returned via a method rather than a property:

    this.ultraDataSource1.Rows[0].GetChildRows(0).SetCount(5);

    this.ultraDataSource1.Rows[0].GetChildRows(0).ResetCachedValues();