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
15
Recreating default FilterConditions like "(All)" "(Blank)" etc. as custom filters
posted

Hi,

I am using the BeforeRowFilterDropDownPopulateEvent to populate the filter drop down of a specific column with custom values.
However, i wan to keep the default "(All)" filter as it not only returns all items, but once selected it also changes the filter icon in the column header so it shows as if no filter has been applied. (the icon is not filled anymore)

Is it possible to recreate this behaviour of "clearinng the filter icon" in a custom filter? i didnt find any special filteroperants or properties regarding this.

I know i can just assign a new DisplayText to the default filter (for localization), but i would still like to know if the exact behavior can be recreated in a custom FilterCondition.

Kind regards,

Steffen

Parents
No Data
Reply
  • 34430
    Offline posted

    Hello Steffen,

    The “cleared” filter icon in the UltraGrid essentially comes from no conditions existing in the applied filter for that particular column. There does not appear to be a way to recreate this outside of not having any conditions for a column, and so if you want a column to show this way, you can utilize the ColumnFilters collection off of the UltraGrid.Rows to get your ColumnFilter object, and then you can call the ClearFilterConditions method on the ColumnFilter to clear the filter icon.

    For example, if you had a column with the key “Number”, sample code for this could look like the following:

    var filter = ultraGrid1.Rows.ColumnFilters["Number"];
    filter.ClearFilterConditions();

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

Children
No Data