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:

Created:

Updated:

Platform:

Replies:

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

Hello,

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;
else
return rowFilter.Replace("[Empty]","") ;
}
protected override DataTable CreateUniqueEntries(DataView dv, string colName)
{DataTable dtt = base.CreateUniqueEntries(dv,colName);
DataRow dr= dtt.NewRow();
dr[0]="[Empty]";
dtt.Rows.InsertAt(dr,2);
return dtt;
}
}


Please refer the below sample and let us know if this helps:
http://websamples.syncfusion.com/samples/Grid.Windows/I71516/main.htm

Regards,
Jeba.


CONFIRMATION

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.

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

;