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

Open Filter Dialog in RadGridViwe via Shortcut

5 Answers 80 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Julian
Top achievements
Rank 1
Julian asked on 26 May 2011, 09:18 AM
Hi guys,

Well, my questions is short as subject: is there possibility to open filter dialog by pressing for instance ALT+C, instead of clicking the filter icon via mouse.

thanks,
Julian

5 Answers, 1 is accepted

Sort by
0
Accepted
Dimitrina
Telerik team
answered on 27 May 2011, 07:52 AM
Hi Julian,

 Yes, you could open the filter dialog by pressing a key combination, or a button. 

If your GridView is named clubsGrid, you may show the filtering window from the code like this:

var firstFilteringDropDown = this.clubsGrid.ChildrenOfType<FilteringDropDown>();
            int columnIndex = this.clubsGrid.CurrentCellInfo.Column.DisplayIndex;
            if (firstFilteringDropDown != null)
            {
                firstFilteringDropDown[columnIndex].IsDropDownOpen = true;
            }

What you need to additionally do is to create a command, that calls this code when the combination of Alt+C occurs. 
<Window.InputBindings>
  <KeyBinding Command="ShowFilter" Key="C" Modifiers="Alt"/>
</Window.InputBindings>

With this XAML, we have added what imput gestures will trigger the command. Now, if the window has focus, and you hit Alt+C , the command "ShowFilter" will get executed. 

Best wishes,
Didie
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Julian
Top achievements
Rank 1
answered on 27 May 2011, 08:18 AM
Thank you guys for this solution :)

regards,
Julian
0
Kasper
Top achievements
Rank 1
answered on 18 Mar 2015, 03:00 PM
Hello there

I know this is an old post but since i used the code in the answer i will write my question/request here.

After the latest update of Telerik I get a NullReferenceException when i call IsDropDownOpened from codebehind. 

Source: Telerik.Windows.Controls.GridView
StackTrace: at Telerik.Windows.Controls.GridView.FilteringDropDown.OnIsDropDownOpenChanged(Boolean oldValue, Boolean newValue)

TargetSite: {Void OnIsDropDownOpenChanged(Boolean, Boolean)}

Is it possible that this can be fixed in the next version of Telerik for WPF?

Best regards,
Kasper



0
Maya
Telerik team
answered on 18 Mar 2015, 03:28 PM
Hi Kasper,

I could apply a blind fix thanks to the StackTrace you sent, but I guess it would be much better if I can test it on my side. Could you take a look at the project attached and let me know how I can reproduce the exception on it ? 

Regards,
Maya
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.

 
0
Kasper
Top achievements
Rank 1
answered on 19 Mar 2015, 08:08 AM
Hello Maya

Thank you for the fast reply.

I tried to reproduce the exception in your solution, and it made me realize that the exception was thrown because i tried to set the IsDropDownOpen on a column that did not have a filter (I got the filter of the wrong column because of some confusion with invisible columns). 

Sorry for bothering you with an exception that was not due to an error in the Telerik framework. And thank you for helping me find the actual error :) 

Best Regards,
Kasper

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