We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Filter empty rows

Thread ID:





71516 Feb 4,2008 12:49 PM UTC Feb 9,2008 07:42 AM UTC WinForms 1
Tags: GridControl
Vincent Denis
Asked On February 4, 2008 12:49 PM UTC


I am using a griddataboudgrid (5.2) in a windows form application. In some columns, rows are empty. I want to filter rows that are empty. Is it possible to have the empty value in the filter list as anyother value?

Jeba S [Syncfusion]
Replied On February 9, 2008 07:42 AM UTC

Hi Vincent,

Sorry for the delay in response.

You can achieve this by deriving the GridFilterBar class.In the derived class override the GridFilterBarRow and CreateUnquieEnteries methods to add the "[Empty]"option in a FilterBar. Below is the code snippets:

public class MyGridFilterBar : GridFilterBar
private GridDataBoundGrid grid1;
public override void WireGrid(GridDataBoundGrid grid, GridStyleInfo style)
{this.grid1 = grid;
base.WireGrid (grid, style);
protected override string GetFilterFromRow(GridDataBoundGrid grid)
{GridCurrentCell cc = grid.CurrentCell;
string s = cc.Renderer.ControlText;
string rowFilter = base.GetFilterFromRow(grid);
if(s != "[Empty]")
return rowFilter;
return rowFilter.Replace("[Empty]","") ;
protected override DataTable CreateUniqueEntries(DataView dv, string colName)
{DataTable dtt = base.CreateUniqueEntries(dv,colName);
DataRow dr= dtt.NewRow();
return dtt;

Please refer the below sample and let us know if this helps:



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon