Setting Up Filtering

6 posts, 0 answers
  1. WILLIAM
    WILLIAM avatar
    134 posts
    Member since:
    Jun 2012

    Posted 27 Feb 2013 Link to this post

    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!!
  2. WILLIAM
    WILLIAM avatar
    134 posts
    Member since:
    Jun 2012

    Posted 27 Feb 2013 Link to this post

    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!
  3. WILLIAM
    WILLIAM avatar
    134 posts
    Member since:
    Jun 2012

    Posted 27 Feb 2013 Link to this post

    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.
  4. WILLIAM
    WILLIAM avatar
    134 posts
    Member since:
    Jun 2012

    Posted 27 Feb 2013 Link to this post

    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!!
  5. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2477 posts

    Posted 28 Feb 2013 Link to this post

    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.

  6. WILLIAM
    WILLIAM avatar
    134 posts
    Member since:
    Jun 2012

    Posted 28 Feb 2013 Link to this post

    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!!!
Back to Top