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
490
Refresh data on a single grid row
posted

Hi,

I have a scenario where I need to lazy load all of the child rows in my grid.  I am lazy loading the underlying data source as well.  Initially, I get all of the data for band 0 and then I bind it to the grid.  At this point I handle the BeforeRowExpanded event.

In the BeforeRowExpanded event I call to my database and get the child rows for the parent row being expanded.  Once I get the data I assign it to the underlying data source via the ListObject property of the row being expanded (e.Row.ListObject). I cast the ListObject as appropriate.

This seems to work ok.  At this point I need to refresh the grid so it picks up the changes to the data source.  I tried to do it with this (still in the BeforeRowExpanded event):

e.Row.Refresh(RefreshRow.ReloadData, true)

The above doesn't seem to work.

However, if I call the following method it does work:

myGrid.Rows.Refresh(RefreshRow.ReloadData, true)

I believe this refreshes all of the rows in the grid and may be less efficient that just refreshing the one row that I need to.  Is that true?  Is there a way to just refresh the one row (and its children) that I need?

Thanks!

Steve