I have a control which has a comboBox and a button where users can select items from a list, but I want to let users write text. I have set theValidateOnTextInput to false but the problem is that when the control loses focus, the text I have introduced is eliminated. How could I accomplish this task? I have read that I can do it with the lookupedit control but I would like to use my control.
XAML<dxg:GridColumn.EditSettings>
<dxe:ComboBoxEditSettings
ItemsSource="{Binding CarCollection}"
DisplayMember="CAR_ID"
ValueMember="CAR_ID"
IsTextEditable="True"
AllowNullInput="True"
AutoComplete="True"
ImmediatePopup="True"
ValidateOnTextInput="False">
<dxe:ComboBoxEditSettings.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" MinWidth="90"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="{Binding CAR_ID}"/>
<TextBlock Grid.Column="1" Text="{Binding CAR_DESCRIPTION}" Margin="15,0,0,0"/>
</Grid>
</DataTemplate>
</dxe:ComboBoxEditSettings.ItemTemplate>
<dxe:ComboBoxEditSettings.Buttons>
<dxe:ButtonInfo GlyphKind="Regular" ClickMode="Release" Command="{Binding SelectCarCommand}"/>
</dxe:ComboBoxEditSettings.Buttons>
</dxe:ComboBoxEditSettings>
</dxg:GridColumn.EditSettings>
Hello Ander,
Please clarify your ultimate goal. Do you wish to add new items in the CarCollection? If so, in which event handler do you wish to perform this? If you explain your scenario in greater detail, we will be able to find the most precise solution for you.
Thanks,
Andrew
We want to manage a car garage for example. When adding new rows, we have to select the CAR_ID at first so we have the following options:
Option 1:
The user introduces an existing CAR_ID and the combobox automatically gives him coincidences, the user can select one of them. This option is a must have. More or less it is working.
Option 2:
The user opens a window clicking a button an selects an option. This window is a must have and works well.
Option 3:
The user introduces a CAR_ID that does not exist in the car collection and we want to save this new CAR_ID.
Thank you,