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

Gridview custom filtering; changing available operators

1 Answer 104 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ahmet
Top achievements
Rank 1
Ahmet asked on 04 Nov 2014, 03:57 PM
Hi,
Let me try to explain my issue. In our gridview some columns are bound to GUID properties in view model where we display the corresponding string value of the respective guid via implementing a custom gridview bound column (let's say instead of displaying the categoryId, we display the category name). Hence, user wants to filter the grid view by typing the name of the category but the filter editor is not visible since the bound type is guid (that's what I understand from the documentation), only the distinct filter is visible to the user. I have overcome this issue by overriding the CreateFieldFilterEditor method like so

public override FrameworkElement CreateFieldFilterEditor()
{
            TextBox searchTextBox = new TextBox();
            Binding searchTextBinding = new Binding("Value");
            searchTextBinding.Mode = BindingMode.TwoWay;
            searchTextBinding.FallbackValue = null;
            searchTextBox.SetBinding(TextBox.TextProperty, searchTextBinding);
            return searchTextBox;
}

Now I have two problems, first of all when I click on Filter button, nothing happens. What I expect is either the gridview filtering event is fired or get an exception with not being able to convert the string to guid. But, nothing happens. What might be the reason that stops filtering even firing?

Secondly, I only have "Is Equal To", "Is Not Equal To", "Is Null" and "IsNot null" as available filter operators. But I also need Contains, Starts With etc.
I dont know where to start. I have been looking at the Custom Filter Descriptors but no luck.

I'd be really glad if you can assist me to the right direction.

Thank you in advance.

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 07 Nov 2014, 01:13 PM
Hi Ahmet,

Filtering in RadGridView is a data operation and it will be performed based on the DataMemberBinding specified for a column. Alternatively, you can specify a FilterMemberPath so that the column to be filtered on another property of the bound business object. For the purpose you should expose a property of your business object to represent the string value corresponding to a GUID.
You can also check our online documentation where the filtering is explained in details.

Let me know how this works for you.

Regards,
Dimitrina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
GridView
Asked by
Ahmet
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or