Filter on key press

2 posts, 0 answers
  1. Bradley
    Bradley avatar
    16 posts
    Member since:
    Aug 2010

    Posted 25 Jul 2011 Link to this post

    I have a RadTreeListView that is bound to a modal and two properties in the modal like this

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

    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!
  2. Ivan Ivanov
    Ivan Ivanov avatar
    1201 posts

    Posted 28 Jul 2011 Link to this post

    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!

Back to Top