In order to display a description rather than an ID, you will need to use the ComboBoxViewer and the ComboBoxEditor. This is done by binding the ComboBoxViewer and ComboBoxEditor to the table that contains the ID’s descriptions and to set its DisplayFormat and ValueMember properties.
The following example demonstrates how to display a description (rather than an ID) using the ComboBoxViewer and ComboBoxEditor.
VB.NET
Dim viewer As New Xceed.Grid.Viewers.ComboBoxViewer( northwindDataSet, “Products”, “ProductID”, “%ProductName%” ) Dim editor As New Xceed.Grid.Editors.ComboBoxEditor( northwindDataSet, “Products”, “ProductID”, “%ProductName%” )
GridControl1.Columns( “ProductID” ).CellEditorManager = editor GridControl1.Columns( “ProductID” ).CellViewerManager = viewer
C#
Xceed.Grid.Viewers.ComboBoxViewer viewer = new Xceed.Grid.Viewers.ComboBoxViewer( northwindDataSet, “Products”, “ProductID”, “%ProductName%” ); Xceed.Grid.Editors.ComboBoxEditor editor = new Xceed.Grid.Editors.ComboBoxEditor( northwindDataSet, “Products”, “ProductID”, “%ProductName%” );
gridControl1.Columns[ “ProductID” ].CellEditorManager = editor; gridControl1.Columns[ “ProductID” ].CellViewerManager = viewer;
|
Imported from legacy forums. Posted by Xceed admin (had 766 views)