This is a migrated thread and some comments may be shown as answers.

How to not Display Displaymember - GridViewMultiComboBoxColumn

1 Answer 103 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Karim
Top achievements
Rank 1
Karim asked on 11 May 2017, 02:39 PM

Hi,

I have used a RadGridView Element with different columns. One column is a GridViewMultiComboBoxColumn with a valuemember and a displaymember, When I drop down the combo I see the displaymember correctly. But when I leave the row I only see the valuemember (1,2,3..)

 

  Private Sub RadGridView2_CellEditorInitialized(sender As Object, e As GridViewCellEventArgs) Handles RadGridView2.CellEditorInitialized
    If e.Column.Name = "FeldArt2" Then
      Dim editor As RadMultiColumnComboBoxElement = e.ActiveEditor
      If IsNothing(editor) = False Then
        Dim el As RadMultiColumnComboBoxElement = editor
        el.AutoCompleteMode = AutoCompleteMode.Suggest
        Dim lFeldArt As New List(Of clFeldArt)
        lFeldArt.Add(New clFeldArt(1, "Date Picker"))
        lFeldArt.Add(New clFeldArt(2, "Textfeld"))
        lFeldArt.Add(New clFeldArt(3, "Combo"))
        lFeldArt.Add(New clFeldArt(4, "Checkbox"))
        el.ValueMember = "FeldID"
        el.DisplayMember = "FeldArt"
        el.DataSource = lFeldArt
        el.AutoSizeDropDownToBestFit = True
        editor.Columns("FeldID").IsVisible = False
      End If
    End If
  End Sub

 

I have attached a file which explain what I mean.

Does anybody has an Idea whats wrong?

Thanks in advance for any help.

Karim

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 15 May 2017, 06:44 AM
Hello Karim, 

Thank you for writing.  

According to the provided code snippet, it seems that you specify the DataSource for the RadMultiColumnComboBoxElement when the editor is initialized. However, the column itself doesn't have a DataSource applied. That is why the value members are displayed in the grid cells. Please refer to the following help article demonstrating how to setup the GridViewMultiComboBoxColumn and bind it to a collection from which to extract the information for the cells' text: http://docs.telerik.com/devtools/winforms/gridview/columns/column-types/gridviewmulticomboboxcolumn

I hope this information helps. Should you have further questions I would be glad to help.

Regards,
Dess
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
GridView
Asked by
Karim
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or