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

Enable Disable Filter in XAML without Code behind

2 Answers 128 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 17 Jan 2013, 04:02 PM
I would like to enable/disable a filter based on a checkbox and I would like to do it only in XAML.

I can see how it is done in code but ideally I would be able to implement this strickly in XAML. For example: Bind something like IsEnabled to the checked status of a ToggleButton.

In my case, I actually have several toggle buttons which each apply filters to the view.

Thoughts?

2 Answers, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 21 Jan 2013, 04:46 PM
Hello Mark,

The only way to set a column filter would be as described in this article.

If you do not want to write anything in code-behind, you can try working with Attached Behavior and implement this code-behind logic in it. In this way you will achieve more MVVM-friendly architecture. Then simply turn on the attached behavior on the grid and the logic will kick-in.

I hope this helps.


Greetings,
Yoan
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Mark
Top achievements
Rank 1
answered on 21 Jan 2013, 09:30 PM
Thank you for your reply.

Yes, I see there is a way to this in code-behind. Now I am looking for a way to do this without code behind.

So I am wondering if I can request a feature of adding and IsEnabled() property to FilterDescriptors. That way, I can set it via bindings to toggle button states to control filtering without the need for code behind.

Thank you for your consideration.
Tags
GridView
Asked by
Mark
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Mark
Top achievements
Rank 1
Share this question
or