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>
Beuller?
Hello Darlene,
I was able to reproduce the behavior you described and have asked our engineering staff to investigate this further. To ensure that it will receive attention, I have logged this behavior in our internal tracking system with a Development ID of 161325.
I have also created a private case to track this issue for you and notify you of any changes. The case number is CAS-129565-C8T7L6. You can access this case at https://es.infragistics.com/my-account/support-activity.
Please let me know if you have any questions.
Sincerely,
Valerie
Developer Support Supervisor - XAML
Infragistics
www.infragistics.com/support
Thanks for the update Valerie.
Our engineers have reviewed this issue and determined it is expected behavior. There is a ComboBox in the edit template of the XamComboEditor that is providing this behavior. It actually has to do with timing. If you press 'D' then wait a couple of seconds and then press 'O' then it would select the entry starting with ‘O’. If you press 'D' and then 'O' without waiting long enough the ComboBox selects 'DOG' since it is looking for a match to 'DO'.
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
Do you have any other questions on this matter?
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.
Also I tested using a normal WPF ComboBox and it behaves as I expect.