Devexpress Xtragrid how to add Combobox editor to a column

I want to place combobox inside one Xtragrid column. I can bind combobox values ​​to an array, but how do you bind combobox to a column?

+7
user-interface winforms devexpress
source share
4 answers

Use the ColumnEdit property of a column to assign a lookupedit control (new). The lookupedit element is a combo box.

+9
source share

This is a simple example of adding a ComboBox to a GridColumn.

Dim xSunday As New DevExpress.XtraEditors.Repository.RepositoryItemComboBox Me.GridView1.Columns("Sunday").ColumnEdit = xSunday xSunday.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor xSunday.Items.Clear() xSunday.Items.Add("Full") xSunday.Items.Add("Half") xSunday.Items.Add("Off") 
+4
source share

In the ColumnEdit property of the column, add the (new) ComboBoxEdit. If you always want this to be visible, always set ShowButtonMode in the column.

This will create a repositoryItemComboBox1 object (this is the default name) into which you can add items if you decide to display them in the drop-down list. those. repositoryItemComboBox1.Items.add ("My text");

+3
source share

You can use ColumnEdit and put the appropriate repository. Then you can bind to this repository.

+2
source share

All Articles