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 Andy,
The LoacCustomization method executes asynchronously. There is no event fired when the load is completed. Why do you need to know when the load completes?
Sincerely, Matt Developer Support Engineer
HI, I am just following up on this thread. If you need further assistance, please let me know. Sincerely, Matt Developer Support Engineer
Hi,
Feature Request has been submitted.
I did notice that the FieldLayouts PropertyChange event does fires after a LoadCustomization method is called. You could wire this event up and bypass the logic init using a global variable that you set during a LoadCustomization process. You could key off of a certain property change to load your summary records.
here a code snippet
load = false;
// xamDataGrid1.FieldLayoutInitializing += new EventHandler<Infragistics.Windows.DataPresenter.Events.FieldLayoutInitializingEventArgs>(xamDataGrid1_FieldLayoutInitializing);
xamDataGrid1.FieldLayouts[0].PropertyChanged += new PropertyChangedEventHandler(MainWindow_PropertyChanged);
}
void MainWindow_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
//throw new NotImplementedException();
if (load)
Dispatcher.BeginInvoke(ew Action (() =>
MessageBox.Show(e.PropertyName);
}), null );Sincerely, Matt Developer Support Engineer
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?
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
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,
Place your summary code inside of the Dispatcher after you call your LoadCustomizations
//add your summary data here
}), null
Sincerely, Matt
I am just following up on this forum thread.
Please let me know if you need further assistance.
Sincerely MattDeveloper Support Engineer