Home Forums WinForms controls Xceed Grid for WinForms How to display a description rather than an ID

Viewing 1 post (of 1 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #17804 |

    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)

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.