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
124
Expanded Rows need to remain expanded after refresh.
posted

I have designated a GroupBy Row after I Set the DataSource on a Grid with 2 Bands.

If I Refresh the Grid, I obtain a list of Rows that are Expanded.

I pass and loop through all of the Grid Rows as a RowsCollection and add them to a List of Rows as follows.

 

 

 

 

 

 

 

 

 

 

 

 

 

Private Sub SetLastFormat(ByVal rows As

RowsCollection)

 

 

For Each oRow As UltraGridRow In

rows

 

 

For Each oSavedRow As Infragistics.Win.UltraWinGrid.UltraGridRow In

mExpandedRows

 

 

If oRow.Equals(oSavedRow)

Then

 

 

'If oRow.Cells("IdClientLogonUser").Value.ToString = oSavedRow.Cells("IdClientLogonUser").Value.ToString Then

oRow.Expanded =

 

True

 

 

For Each childBand As UltraGridChildBand In

oRow.ChildBands

SetLastFormat(oRow.ChildBands(0).Rows)

 

 

Next

 

 

End

If

 

 

Next

 

 

Next

 

 

End

Sub

Afterward, the DataSource is reset, after which I then need to loop through the Grid Rows and Expand each row that has been added to mExpandedRows.

  • 18495
    Suggested Answer
    posted

    Hello Sam,

    The UltraGrid does not keep any rows expanded after a reset of the DataSource because it has no way to be sure that the same rows still exist after the reset.  What you are currently doing is the best way to keep rows expanded after a data source reset.