I want the cell editor for one of the columns in a data grid to be a combo box. When I set the cell editor for the column ("MyField"), I get the desired behavior for that column, however, another column ("MyOtherField") in my grid (the only other editable column with the same data type, string) also uses the combo box editor. I want "MyOtherField" to retain the default text editor. Here's the method I use to set the editor:
private void InitializeEditor()
{
MyDataSet dataSet = this.GetMyDataSet();
DataTemplate template = new DataTemplate();
FrameworkElementFactory factory = new FrameworkElementFactory(typeof(ComboBox));
factory.SetValue(ComboBox.ItemsSourceProperty, this._choices);
CellEditorBindingExtension binding = new CellEditorBindingExtension();
factory.SetValue(ComboBox.SelectedValueProperty, binding);
template.VisualTree = factory;
Column column = this._gridControl.Columns["MyField"];
column.CellEditor.EditTemplate = template;
}
How do I set the editor only for the column "MyField"? Thanks.
Regards,
Mark