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

Formatting Fractions

Thread ID:

Created:

Updated:

Platform:

Replies:

89881 Sep 9,2009 03:47 PM UTC Sep 16,2009 12:21 PM UTC ASP.NET Web Forms (Classic) 1
loading
Tags: GridGroupingControl
Xu Shi
Asked On September 9, 2009 03:47 PM UTC

I am using the GridControl and showing fractions within cells. I use the QueryCellValue callback for performance reasons. Is it possible to show fractions with a format of one number ontop of the other like:


1
---
2

Instead of 1/2




Melba Winshia [Syncfusion]
Replied On September 16, 2009 12:21 PM UTC

Hi,

Thank you for your interest in Syncfusion Products.

Yes. You can use below code snippet to show fractions with a format of one number on top:




protected void GridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if (e.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell || e.TableCellIdentity.TableCellType ==

GridTableCellType.AlternateRecordFieldCell)
{

if(e.TableCellIdentity.Column.Name=="SNo")
{
string s = e.Style.CellValue.ToString();
string[] split = s.Split(new char[] { '/' });
e.Style.CellValue= split[0]+"
---

}

}
}



Please try this and let me know if this helps.

Thanks,
Melba


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

;