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
1490
XamDatagrid: Style FilterCellValuePresenter and delay filter action
posted

Hello,

I have a question with two parts:

1. When the user types into the filter cell, the grid is immediatly filter. Is there a way (and performance benefit) to delay this? Like in a regular textbox you can delay the binding.

2. When I want to style the FilterCellValuePresenter  I assume to use the standard style from DataPresenterGeneric_Express.xaml, copy and modify the style FilterCellValuePresenter. Is there another simpler way to replace the filter icon?

Thanks

Niko

  • 520
    Offline posted

    Hello,

    The filtering of XamDataGrid is designed to be updated on every key stroke. In order to modify the default behavior, you will have to re-template the filtering. I've attached a sample where I've replaced the FilterCellValuePresenter with a textbox that will filter the column on Enter Keystroke only. While this makes the box looks quite naked and will need styling, this brings me to your second question.

    Generally if your only goal is to have filtering when the complete filter key has been entered, and the icon is there just for visual indication that this is a filter field, it might be better to just add the textbox to a grid and add your desired image to it.

    However, if you want to have functionalities to the filter button as well, you can check the template for the filter button in the following forum thread.

    Please let me know if you have further questions.

    Sincerely,
    Tihomir Tonev
    Associate Software Developer
    Infragistics

    XDGFilterOnEnter.zip