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

Number formatting ignored in filter bar cell

Hi,

We're using a GridGroupingControl v8.

We have a column containing decimal values. The column has the FilterBarCell Format value set to "#.##". So, for example, the decimal value 1234.5678 is displayed as 1234.6 in the filter options drop down.

But this formatting is ignored in the actual filter bar cell, that displays the selected filter value. So if the user selects 1234.6 in the drop down, 1234.5678 is displayed in the filter cell.

How can we get the filter cell to use the assigned number formatting?

Thanks.

---
Richard


3 Replies

MC Mercy C Syncfusion Team January 20, 2012 10:22 AM UTC

Hi Richard,

Thanks for your interest in Syncfusion products.

You can achieve formatting FilterBarCell values by setting FilterBarCell Format.

foreach (GridColumnDescriptor col in this.gridGroupingControl1.TableDescriptor.Columns)
{
if (col.Appearance.AnyRecordFieldCell.CellValueType == typeof(double))
{
col.AllowFilter = true;
col.Appearance.FilterBarCell.Format = "#.##";
}
}

Please to the sample in the following link

http://www.syncfusion.com/downloads/Support/DirectTrac/89839/WindowsFormsApplication11-1371427203.zip

Please let me know if you have any concerns.

Regards,
Mercy.C




RI Richard January 26, 2012 03:11 PM UTC

Hi Mercy,

Thanks for your reply.

The provided sample project uses v9 of the grid. We are still using v8, as stated above.

Since I do not have v9, I wasn't able to try the sample as is. But after converting it to use v8, the filter bar cell ignores the formatting. "12.34567" is displayed in the cell, rather than the expected "12.35", given the formatting "#.##".

Is our only solution here to upgrade to v9?

Thanks.

---
Richard



RB Ragamathulla B Syncfusion Team February 1, 2012 12:18 PM UTC

Hi Richard,

Thanks for the update.

Please migrate our later version which is resolve your issue. Let me know if you have any further concerns.

Regards,
Ragamathullah B.


Loader.
Live Chat Icon For mobile
Up arrow icon