views:

627

answers:

2

I need to do some post-processing on a silverlight datagrid once all the rows are. I don't see any events that fire once that's done; what am I missing?

Code samples or links are greatly appreciated.

+1  A: 

I found the following solution. It's untested, but given that the question was exactly the same as yours, it should work.

dataGrid.LoadingRow += new EventHandler(dataGrid_LoadingRow);

void dataGrid_LoadingRow(object sender, DataGridRowEventArgs e)
{
    dataGrid.LoadingRow -= new EventHandler(dataGrid_LoadingRow);

    this.Dispatcher.BeginInvoke(delegate

    {
         /*Process My Logic*/

    });
}

(Source: yifung @ Silverlight Forums)

George Stocker
A: 

Why would you need that? AFAIK you'll get control back when the grid is populated and the binding is complete.

myGrid.ItemsSource = myObservableCollection;
// here everything is loaded
R4cOON
If only this were true... I've found that the rows are not always fully loaded immediately after setting the ItemsSource. One way I've had to work around this is by setting up a timer to do the post-processing at some interval after I set the ItemsSource.
Joshua Poehls