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
267
Force InitializeRow again for visible rows?
posted

Is there a way for force InitializeRow() to be raised again for the visible rows and clear the cached state of rows that were once in view?

 

I've got some custom appearance code in my InitalizeRow handler for a grid with thousands of rows. The UltraGrid is doing a great job of only raising the event for the rows that are currently visible and it must keep track of which rows have been visible as the event is not re-raised when a row that was visible is scrolled out of view and then back into view. This is good. 

Imagine I have a color picker above the grid where the user can pick a color for rows that meet certain criteria. When the user changes that color, I don't want to call Rows.Refresh(RefreshRow.FireInitializeRow) as I observed this fires the event for all rows, not just the visible ones. I thought perhaps one option would be to iterate over just the visible rows explicitly refreshing them, but this doesn't handle the case where a row was visible and now scrolled out of the visible area - the grid won't raise the event again when the row is scrolled into view.

 Refresh() and Update() don't seem right. Calling DataBind() seems heavy-handed. I appreciate any suggestions.Best,Mark