How to understand when grid's customization is loaded?
This method works asynchronously and doesn't return a value, this is also no LayoutLoaded event.
xamDataGrid.LoadCustomizations(...);
a bug?
HI,
I am just following up on this forum thread.
Please let me know if you need further assistance.
Sincerely MattDeveloper Support Engineer
Place your summary code inside of the Dispatcher after you call your LoadCustomizations
Dispatcher.BeginInvoke(ew Action (() =>
{
//add your summary data here
}), null
Sincerely, Matt
Matt, thanks for your reply.
But it won't work. Here a sample code:
xamDataGrid1.DataSource = myDataView;
xamDataGrid1.LoadCustomizations();
After these two line of code you will be getting multiple PropertyChanged events for the Fieldayout. And there is no way to say when it was the layout loaded or loaded at all.
In your code sample the message box could popup just because of some data is bound to a DataGrid.
HI , You could use a global variable and have it initialized to false and only turn it on when you call the LoadCustomizations. Then when you can turn it off
Here a code snippet
void MainWindow_PropertyChanged(object sender, PropertyChangedEventArgs e) { //throw new NotImplementedException(); if (load) { Dispatcher.BeginInvoke(new Action(() => { MessageBox.Show(e.PropertyName); }), null); } }
Sincerely,
Matt
The problem is that FieldLayout_PropertyChanged event is also fired multiple times whe I bind data to the grid. So there is still no way to deferentiate between data binding and layout loading events.
Unless there is a special property name which gets changed when layout is loaded. Do you that?