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

Filter on key press

1 Answer 58 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Bradley
Top achievements
Rank 1
Bradley asked on 26 Jul 2011, 04:03 AM
I have a RadTreeListView that is bound to a modal and two properties in the modal like this

<telerik:RadTreeListView.Columns>
    <telerik:GridViewDataColumn Header="Name" DataMemberBinding="{Binding Name}"/>
    <telerik:GridViewDataColumn Header="Description" DataMemberBinding="{Binding Description}"/>
</telerik:RadTreeListView.Columns>

I want to provide the user with a shortcut to quickly filter the view, so that instead of having to click on the Name header and then a text box, as soon as the user types a key while the treelist is in focus it automatically pops open the filter box and sets the focus to the first text box (inserting whatever key the user just pressed into it).  Haven't been able to figure out how to do this, or if it's even possible.  Thanks!

1 Answer, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 28 Jul 2011, 04:17 PM
Hi Bradley,

You can show current column's FilteringControl in this way:
testTree.ChildrenOfType<GridViewHeaderCell>().Where(c => c.Column == testTree.CurrentCell.Column).First().ChildrenOfType<FilteringDropDown>().First().IsDropDownOpen = true;
Then on FilteringControl's Loaded event you can find the RadMaskedTextBox editor in the visual tree and set its text. I would advise you to change TreeListView's EditTriggers, in order to prevent it from entering edit mode when you hit an input key.

Kind regards,
Ivan Ivanov
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
TreeListView
Asked by
Bradley
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
Share this question
or