Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
340
XamComboEditor Text Search Behavior Differs When Collapsed v. Expanded
posted

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>