I have a XamComboEditor as a column in my XamDataGrid. My tester noticed that when the XamComboEditor is collapsed (as in the case when you tab over to that field) and start typing text to find an item in the collection, the search is only by the first character. So if I were to type "DOG" the XamComboEditor will select the first item that starts the 'D', then the first item that starts with 'O' and then the first item that starts with 'G' instead of remembering the previously entered characters and selecting the first item that starts with 'D' then the first item that starts with 'DO' and then the first item that starts with 'DOG'. The latter (searching 'D', 'DO', 'DOG') is how the XamComboEditor behaves when it's expanded. I'd like the XamComboEditor to always behave this way, but how?
Here is my xaml-
<Style x:Key="AnomalyTypeFieldStyle" TargetType="{x:Type igEditors:XamComboEditor}"> <Setter Property="ItemsSource" Value="{Binding DataContext.AnomalyTypes, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"/> <Setter Property="DisplayMemberPath" Value="Value"/> <Setter Property="ValuePath" Value="Key"/> </Style>
<igDP:XamDataGrid Grid.Row="1" DataSource="{Binding AnomalyMappings}" ActiveDataItem="{Binding ActiveAnomalyMapping}" Margin="0,4,0,4" RecordAdded="AnomalyGrid_OnRecordAdded" GroupByAreaLocation="None" MinWidth="200" x:Name="AnomalyGrid" IsEnabled="{Binding AnomalyFieldName, Converter={StaticResource StringEnabledConverter}}" PreviewKeyDown="AnomalyGrid_OnPreviewKeyDown" CellChanged="xamDataGrid_CellChanged"> <igDP:XamDataGrid.Resources> <Style TargetType="{x:Type igDP:DataRecordCellArea}"> <Style.Triggers> <DataTrigger Binding="{Binding Path=IsAddRecord}" Value="True"> <Setter Property="Background" Value="#FFf1f9e6"></Setter> <Setter Property="BorderBrush" Value="{DynamicResource NcsGreenBrush}"/> <Setter Property="BorderThickness" Value="1"/> <Setter Property="BackgroundActive" Value="#FFf1f9e6"/> <Setter Property="BorderActiveBrush" Value="{DynamicResource NcsGreenBrush}"/> <Setter Property="BackgroundHover" Value="#FFf1f9e6"/> <Setter Property="BorderHoverBrush" Value="{DynamicResource NcsGreenBrush}"/> </DataTrigger> </Style.Triggers> </Style> <Style TargetType="{x:Type igDP:RecordSelector}"> <Style.Triggers> <DataTrigger Binding="{Binding Path=IsAddRecord}" Value="True"> <Setter Property="Background" Value="{DynamicResource NcsGreenBrush}"></Setter> </DataTrigger> </Style.Triggers> </Style> </igDP:XamDataGrid.Resources> <igDP:XamDataGrid.FieldSettings> <igDP:FieldSettings AllowGroupBy="False" LabelClickAction="Nothing"/> </igDP:XamDataGrid.FieldSettings> <igDP:XamDataGrid.FieldLayoutSettings> <igDP:FieldLayoutSettings AllowAddNew="True" AllowDelete="True" AddNewRecordLocation="OnBottomFixed"/> </igDP:XamDataGrid.FieldLayoutSettings> <igDP:XamDataGrid.FieldLayouts> <igDP:FieldLayout> <igDP:Field Name="SearchText" Label="Search Text" Width="*"/> <igDP:Field Name="AnomalyCode" Label="Feature/Anomaly Type" Width="*"> <igDP:Field.Settings> <igDP:FieldSettings EditorType="{x:Type igEditors:XamComboEditor}" EditorStyle="{StaticResource AnomalyTypeFieldStyle}"/> </igDP:Field.Settings> </igDP:Field> </igDP:FieldLayout> </igDP:XamDataGrid.FieldLayouts> </igDP:XamDataGrid>
Hello Darlene,
Do you have any other questions on this matter?
Sincerely,
Valerie
Developer Support Supervisor - XAML
Infragistics
www.infragistics.com/support
Here is the sample I used to create the video.
I tested this in sample using NetAdvantage for WPF 2013 Volume 2 build 13.2.20132.2036 and I get the behavior described by engineers.
See attached video.
Please let me know if you have any questions.
Also I tested using a normal WPF ComboBox and it behaves as I expect.
Valerie,
I understand the timing with waiting a few seconds and it behaves this way when the combo box is expanded. If I type quick when it's expanded it will select 'DOG'. The problem is that when the combobox is collapsed it only searches for the first character and never for 'DOG' no matter if there is a delay or not between typing subsequent characters.
-Darlene