Focus filter field

6 posts, 1 answers
  1. Paweł
    Paweł avatar
    46 posts
    Member since:
    May 2013

    Posted 01 Jul 2013 Link to this post

    Hi,
    I'd like to know whether it's possible to focus filtering control in the first column. Our customer want to speed up searching, so he doesn't want to click on textbox to filter - he just want to start typing text from keyboard and gets result asap.
    I tried to add event in the constructor:

    productsDG.FieldFilterEditorCreated += new EventHandler<Telerik.Windows.Controls.GridView.EditorCreatedEventArgs>(productsDG_FieldFilterEditorCreated);

    void productsDG_FieldFilterEditorCreated(object sender, Telerik.Windows.Controls.GridView.EditorCreatedEventArgs e)
    {
        if (e.Column.Header.ToString() == "Nazwa")
            e.Editor.Focus();
    }

    but it seems it doesn't work.
  2. Yoan
    Admin
    Yoan avatar
    1180 posts

    Posted 02 Jul 2013 Link to this post

    Hello Paweł,

    I'm not sure that I have understand your question. Will it be possible to share a bit more details? May I ask you to clarify what exactly would you like to achieve?

    Looking forward to hearing from you!

    Regards,
    Yoan
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. Paweł
    Paweł avatar
    46 posts
    Member since:
    May 2013

    Posted 03 Jul 2013 Link to this post

    Hello Yoan,

    When I'm using radGridView, sometimes when I need, I'm changing filtering mode (depends on gridView) to:
    FilteringMode="FilterRow"

    Also I'm able to change the default FilterOperator by using:
    productsDataGrid.FilterOperatorsLoading += new EventHandler<Telerik.Windows.Controls.GridView.FilterOperatorsLoadingEventArgs>(productsDataGrid_FilterOperatorsLoading);
    void productsDataGrid_FilterOperatorsLoading(object sender, Telerik.Windows.Controls.GridView.FilterOperatorsLoadingEventArgs e)
    {
      e.DefaultOperator1 = Telerik.Windows.Data.FilterOperator.Contains;
    }

    And that works great.

    When I have FilteringMode="FilterRow" there are two controls in Fitlering - Label with column header and TextBox where I can type text to filter. And - somehow - I want to focus that TextBox. Let's say I created radGridView with 7 columns and I want to set focus to filtering TextBox in the first column. How can I do that?

    I hope you understand what I mean ;-)
  4. Answer
    Yoan
    Admin
    Yoan avatar
    1180 posts

    Posted 03 Jul 2013 Link to this post

    Hi Paweł,


    I can suggest you to check this forum thread where this question has already been discussed. Although the forum thread targets Silverlight, the same approach is applicable for WPF as well.


    Regards,
    Yoan
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  5. Paweł
    Paweł avatar
    46 posts
    Member since:
    May 2013

    Posted 03 Jul 2013 Link to this post

    Thank you for your answer. I'll check it (probably in few days because of vacation).
  6. Yoan
    Admin
    Yoan avatar
    1180 posts

    Posted 03 Jul 2013 Link to this post

    Hi Paweł,

    Then I will close this thread for now. Please, do not hesitate to open it, as soon as you have the time to test the mentioned approach.

     

    Regards,
    Yoan
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top