Hi all,
we are using RadGridView version 2016.2.613.45 (.NET 4.5, Visual studio 2017, C#) and are having issues with this functionality:
https://docs.telerik.com/devtools/wpf/controls/radgridview/filtering/how-to/howto-customize-the-default-field-filter-editor#filter-as-user-types
Basically, we have implemented a functionality to perform the filtering on every change(key press) in the filter bar.
However, we found a small issue(not to say a bug :) ).
When the filter mode is set to "RowFilter", and user is performing a filtering on numeric column, he is not able to type in the dot character(.).
The only way to get the dot in the filter is to type in the number and afterwards put the dot where you need it.
Example: trying to search for the number 556.32 you would need to type in the 55632 and afterwards place the dot where it needs to be.
This is only manifested when the filtering is set to trigger every time a user types. If we disable the functionality(remove the implementation), it works fine.
The implementation:
XAML:
<telerik:RadGridView ItemsSource="{Binding}" x:Name="radGridView" AutoGenerateColumns="False" > <telerik:RadGridView.Resources> <custom:ConditionalConvertor x:Key="converter"></custom:ConditionalConvertor> </telerik:RadGridView.Resources> <telerik:RadGridView.Columns> <telerik:GridViewDataColumn DataMemberBinding="{Binding SampleText}" Header="Sample Text" > </telerik:GridViewDataColumn> <telerik:GridViewDataColumn DataFormatString="{}{0:c0}" DataMemberBinding="{Binding SampleNumber,Converter={StaticResource converter}}" Header="Sample Number" ></telerik:GridViewDataColumn> </telerik:RadGridView.Columns> </telerik:RadGridView>
In the code behind, we simply attach to the appropriate event:
this.radGridView.FieldFilterEditorCreated += WPFDataGrid_FieldFilterEditorCreated;
and in the "WPFDataGrid_FieldFilterEditorCreated" method we do:
private void WPFDataGrid_FieldFilterEditorCreated(object sender, EditorCreatedEventArgs e){ var FilterEditor = e.Editor as Telerik.Windows.Controls.Filtering.Editors.StringFilterEditor; if (FilterEditor != null) { FilterEditor.MatchCaseVisibility = Visibility.Collapsed; FilterEditor.BorderBrush = new SolidColorBrush(Colors.Transparent); FilterEditor.Loaded += (s1, e1) => { var textbox = e.Editor.ChildrenOfType<TextBox>().Single(); textbox.TextChanged += (s2, e2) => { textbox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); }; }; } else { if (e.Editor is TextBox) { var textbox = e.Editor as TextBox; textbox.TextChanged += (s2, e2) => { textbox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); }; } }}
Any help would be appreciated.
Regards,
Igor