This is a migrated thread and some comments may be shown as answers.

Setting Up Filtering

5 Answers 67 Views
GridView
This is a migrated thread and some comments may be shown as answers.
WILLIAM
Top achievements
Rank 1
WILLIAM asked on 27 Feb 2013, 07:29 PM
Our users are very frustrated with the filtering mechanism for grids.  I have the FilterMode set to FilterRow.  The issue is that users have to type the criteria, then use the mouse to click the filter icon and then click the operator.  What they want is for the programmers to set the filter to "StartsWith" so that all they have to do is type and hit enter.

When the grid is setup and the columns are added, I create a new ColumnFilterDescriptor for each column.  However, it seems that this is completely ignored.  What is the point of creating it, if it's not going to be used?  I don't know, it just seems to me like this should be a very simple thing to accomplish, yet it's impossible.

Is there anything that can be done to make this more user friendly, or at least easier for the programmers to handle??

Sorry!!  I'm just very frustrated!!

5 Answers, 1 is accepted

Sort by
0
WILLIAM
Top achievements
Rank 1
answered on 27 Feb 2013, 08:32 PM
Here is what we are trying to do as a work around.  See the attached image.  I want to get rid of the CaseSensitive and the Filter Buttons.  All I want is the text box and it should fill out the column.  How do I get to these controls?  Is there an example where Xaml is either replacing these or manipulating them in some way?

Thanks!
0
WILLIAM
Top achievements
Rank 1
answered on 27 Feb 2013, 09:56 PM
I have figured out how to hide the CaseSensitive button.  Now I need to find the filter button and hide it.  What type of control is the filter button?  I'm using args.Editor.FindChildByType<RadButton>(), but that's not returning anything.
0
WILLIAM
Top achievements
Rank 1
answered on 27 Feb 2013, 11:45 PM
I have found a way to get to the RadDropDownButton that pops open the Operators list.  From what I understand, setting the IsOpen property to True, should mean that the DropDown should be displayed as open.  However, it's not; I still have to click on it to activate it. How do I get the dropdown of FilterOperators to show/open automatically/programmatically?

Thanks!!
0
Rossen Hristov
Telerik team
answered on 28 Feb 2013, 07:26 AM
Hi,

I think that you don't really need to be doing custom ColumnFilterDescriptors. Setting the default filter operator is described in this article.

Hiding the match case button is described in this article. The pictures are of the FilteringControl but the same logic applies for the FilterRow since the editor is one and the same.

So if you follow these two articles, your users will be able to type something and hit enter and the filter will be applied. They don't even need to open the filter operator drop-down.

So all you need to do is the following:

private void clubsGrid_FilterOperatorsLoading_1(object sender, Telerik.Windows.Controls.GridView.FilterOperatorsLoadingEventArgs e)
        {
            if (((GridViewDataColumn)e.Column).DataType == typeof(string))
            {
                e.DefaultOperator = FilterOperator.StartsWith;
            }
        }
 
        private void clubsGrid_FieldFilterEditorCreated_1(object sender, Telerik.Windows.Controls.GridView.EditorCreatedEventArgs e)
        {
            var editor = e.Editor as StringFilterEditor;
            if (editor != null)
            {
                editor.MatchCaseVisibility = Visibility.Collapsed;
            }
        }

I have attached a sample project that demonstrates this.

I hope this helps.

Greetings,
Rossen Hristov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
WILLIAM
Top achievements
Rank 1
answered on 28 Feb 2013, 02:15 PM
Perfect!!!!  In searching the forums previously it seemed that others were asking for this same functionality and it didn't seem possible.  This is what I needed.  Thank you!!!
Tags
GridView
Asked by
WILLIAM
Top achievements
Rank 1
Answers by
WILLIAM
Top achievements
Rank 1
Rossen Hristov
Telerik team
Share this question
or