Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2085
Xam Grid Filter Menu Default Focus on Search Box
posted

Is there a way to automatically set the focus on the grid menu filter drop down to be the search text box so the user does not have to open the filter menu drop down and then click in the search box?

Parents
  • 34430
    Offline posted

    Hello Gary,

    To set focus on the XamGrid’s FilterMenu search textbox, I would recommend writing a Style for the primitive FilterSelectionControl and using an EventSetter to handle the Loaded event. This will fire each time the FilterMenu is opened. In the Loaded event handler, cast the sender to a FilterSelectionControl object and use the Utilities class to obtain the FilterTextBox object from the FilterSelectionControl.

    Normally, from there, I would recommend just calling FilterTextBox1.Focus(), but it appears there is a timing issue with this, so I would recommend using Dispatcher.BeginInvoke(Action a, DispatcherPriority.Background), where the Action calls FilterTextBox1.Focus().

    I have attached a sample application to demonstrate the above.

    Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Developer Support Engineer I
    Infragistics Inc.
    www.infragistics.com/support

    XamGridFilterFocusCase.zip
Reply Children