I've got a XamDataGrid where one column (Column A) uses a XamComboEditor with a set number of choices, and an adjacent column (Column B) also using a XamComboEditor, should use a particular set of choices based on the selection in Column A.
I'm open to suggestions for how best to accomplish this, but I have this much so far:
I've created several styles as resources for the control with different ItemsProvider settings.
Column A has a SelectedItemChanged event handler.
In the ColumnA_SelectedItemChanged method, I check the newly selected value, and I want to change the EditorStyle for the changed record's Column B to the one with the appropriate ItemsProvider.
The problem I'm having with this approach is how to identify the changed record within the SelectedItemChanged event. The method footprint, which I got from another forum post, is ColumnA_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e). The event args just have the new and old values, and there doesn't seem to be a way to get a handle on the record from the XamComboEditor object.
So is there a way to modify this event handler, maybe with a different type for the event args, which would get me a handle on the Record? Or is there another way I should approach this problem?
Thanks.
Hello,
A better way to implement this would to use a binding on the second combo (Column B) to the underlying value from Column A and then use a converter to limit the items in the drop down list. This would allow the user to select to view the drop down in Column B without having to select the corresponding item in Column A first.
Please see attached sample.
Let me know if you have any questions.
Sincerely,
Valerie
Developer Support Supervisor - XAML
Infragistics
www.infragistics.com/support
Thanks Valerie, your suggestion is definitely a better/cleaner approach than what I was trying to do.