Home Forums WinForms controls Other WinForms controls Images in a Wincombobox Reply To: Images in a Wincombobox

User (Old forums)
Member
Post count: 23064

Ok it works fine! Thx !

Now i want to put this WinComboBox in a grid like this :

‘******************************
Dim cboIcon As New Xceed.Editors.WinComboBox
Dim col As Xceed.Grid.Column = New Xceed.Grid.Column(“Icon”, GetType(Bitmap))
cboIcon.DropDownControl.Columns.Add(col)
Dim NewRow As Xceed.Grid.DataRow
NewRow = cboIcon.DropDownControl.DataRows.AddNew()
NewRow.Cells(0).Value = Icon1
NewRow.EndEdit()
NewRow = cboIcon.DropDownControl.DataRows.AddNew()
NewRow.Cells(0).Value = Icon2
NewRow.EndEdit()

Dim cboIconEditor As New ComboBoxEditor(cboIcon)
cboIconEditor.TemplateControl.DisplayFormat = “%Icon%”
MyRow.Cells(“ColIcon”).CellEditorManager = cboIconEditor
MyRow.Cells(“ColIcon”).CellViewerManager = New Xceed.Grid.Viewers.ComboBoxViewer(cboIcon)

AddHandler cboIcon.SelectedValueChanged, AddressOf CboIcon_SelectedValueChanged

‘********************************************************************
My WinComboBox appears in my cell but when i change the selectedvalue, the string “%Icon%” appears too and not the selected bitmap.

Can you tell me how can i put the bitmap in my cell after the selectedvalueChanged event ?

Thx again.

Imported from legacy forums. Posted by Pierrick (had 3496 views)