I have gridcontrol combobox column which display list of datatypes from db (eg: varchar(10), int, ... etc))

I'd like the user to be able to change varchar(10) to any other length like varchar(50) , but i don't want to add it to the combobox datasource, so varchar(50) to be displayed as text but not exist in the combobox items

  <dxg:GridColumn FieldName="DataType"
                                Header="Data Type">
                    <dxg:GridColumn.EditSettings>
                        <dxe:ComboBoxEditSettings ItemsSource="{Binding DataTypes}" DisplayMember="Type" ValueMember="Type"/>
                    </dxg:GridColumn.EditSettings>
                </dxg:GridColumn>
1

There are 1 answers

0
Eng Dev On

This worked for me, I don't know if that the best solution or is it a good practice to add both column editsettings and edittemplate together or not but it works anyway

<dxg:GridColumn FieldName="DataType" Header="Data Type"> <dxg:GridColumn.EditSettings> <dxe:ComboBoxEditSettings DisplayMember="Type" ValueMember="Type" ItemsSource="{Binding DataTypes}" /> </dxg:GridColumn.EditSettings> <dxg:GridColumn.EditTemplate> <ControlTemplate> <dxe:TextEdit Name="PART_Editor" EditValue="{Binding Data.DataType}"/> </ControlTemplate> </dxg:GridColumn.EditTemplate> <dxg:GridColumn.DisplayTemplate> <ControlTemplate> <dxe:TextEdit EditValue="{Binding Data.DataType}"/> </ControlTemplate> </dxg:GridColumn.DisplayTemplate> </dxg:GridColumn>