I am converting a windows form application to wpf that allows the user to fill in a grid by clicking a cell, which opens a menu below the cell, then clicking a menu item. After the user clicks the menu in the first column, the menu choice determines which menu appears in the second column and so on for the third column. I have the menus running by attaching each menu as a custom editor. Each row in the second and third columns get a unique menu using the Editor Style Selector which is working when the field layout initializes. The last piece I need to make this all work is to be able to somehow manually cause the Editor Style Selector to run after I get a menuitem choice in a running grid.
How do I programmatically trigger an Editor Style Selector event?
I figured it out with the help of priority support.
xamDataGrid.DataSource = null;
xamDataGrid.FieldLayouts.Clear();
xamDataGrid.DataSource = myData;
This reruns the FieldLayout initialized event and connects the correct menu.
I have a similar issue in that the editor I display in field 2 depends on the value entered in field 1. In some situations I want a XamComboEditor and in others a XamTextEditor. I used the EditorStyleSelector of the FieldSettings and it works for the initial values.
However, it doesn't respond to a change in value of field 1.
Surely for this behaviour I should't have to clear the datasource and re-instate it. There has to a better way.
And I would appreciate a timely reply from Infragistics on this - as replying in 3 weeks time isn't of much use.