Home Forums WinForms controls Xceed Grid for WinForms loosing selected value when changing cells Reply To: loosing selected value when changing cells

User (Old forums)
Member
Post count: 23064

Instead of using 2 ComboBoxes (1 for viewing, 1 for editing), just use for both viewing and editing. If you use a GridComboBox, you don’t have to wrap it in a CustomEditor/ControlViewer. Like this:<pre>Xceed.Grid.Editors.GridComboBox colorCombo = new Xceed.Grid.Editors.GridComboBox();
Type colorType = typeof(System.Drawing.Color);
foreach(PropertyInfo p1 in colorType.GetProperties(BindingFlags.Public | BindFlags.Static))
colorCombo.Items.Add(p1.Name);
colParam.CellEditor = colorCombo;
colParam.CellViewer = colorCombo;</pre>

Imported from legacy forums. Posted by Tommy (had 472 views)