Home Forums WinForms controls Xceed Grid for WinForms Using Xceed Editors on Grid v2.5 Reply To: Using Xceed Editors on Grid v2.5

User (Old forums)
Member
Post count: 23064

You can use the CellEditor property on the column class, and set it to a GridComboBox (included with the editors of version 2.5 of the gird).

Here is a code snippet taken from another thread on the forums :

GridComboBox comboEditor = new Xceed.Grid.Editors.GridComboBox();
this.Columns[ colNames[i]].CellEditor = comboEditor;
this.Columns[ colNames[i]].CellViewer = comboEditor;

SqlCommand comm = new SqlCommand(“Get”+colNames[i]+”List”);
//appConn.GetData will return a filled dataset containing the display/value items for the combobox
DataSet ds2 = appConn.GetData(comm, colNames[i]+”DS”, colNames[i]+”Tbl”);

comboEditor.DataSource = ds2.Tables[colNames[i]+”Tbl”];

comboEditor.DisplayMember = “DisplayValue”;

comboEditor.ValueMember = colNames[i];

Imported from legacy forums. Posted by André (had 3408 views)