Skip to content

DevExpress-Examples/asp-net-web-forms-grid-blanks-and-non-blanks-header-filter-items

Repository files navigation

Grid View for ASP.NET Web Forms - How to create ShowBlanksValue and ShowNonBlanksValue items in the header filter

GridViewDataComboBoxColumn does not render (Blank) and (NonBlank) items if the HeaderFilterMode property is set to CheckedList. Call the FilterValue.CreateShowBlanksValue and FilterValue.CreateShowNonBlanksValue methods in the HeaderFilterFillItems event handler to add these items.

protected void grid_HeaderFilterFillItems(object sender, ASPxGridViewHeaderFilterEventArgs e) {
    if (e.Column.FieldName != "CategoryNameNull")
        return;
    e.Values.Insert(0, FilterValue.CreateShowBlanksValue(e.Column, "Blanks"));
    e.Values.Insert(1, FilterValue.CreateShowNonBlanksValue(e.Column, "Non Blanks"));
}

Files to Review

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)

About

Add (Blank) and (NonBlank) items to a header filter in CheckedList mode.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •