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. Image for the cookie policy date
close icon

Date Formatting in Filters of filterbar

Hi, I''m using the GridDataBoundGrid. And I was wondering if you can format the date in the filterbar? (ex. ddd dd/MM/yyyy) And how? Thanks a lot, Tom

2 Replies

AD Administrator Syncfusion Team October 5, 2004 05:58 AM UTC

We will try to make this easier, but for now I think you would have to loop through the entries in the drop list and explicitly format them. Below is a code snippet for the BirthDate column in the Employees table of the FilterBar sample.
theFilterBar.WireGrid(this.gridDataBoundGrid1);
//change the dateformats
int col = this.gridDataBoundGrid1.Binder.NameToColIndex("BirthDate");
if(col > -1)
{
	DataTable dt = (DataTable) this.gridDataBoundGrid1[1, col].DataSource;
	for(int i = 2; i < dt.Rows.Count; ++i)
		dt.Rows[i][0] = DateTime.Parse((string) dt.Rows[i][0]).ToString("ddd dd/MM/yyyy");
}


TO Tom October 5, 2004 06:03 AM UTC

Thank you very much! I really appreciate your help.

Loader.
Live Chat Icon For mobile
Up arrow icon