HA
haneefm
Syncfusion Team
April 19, 2007 04:02 PM UTC
Hi Dinesh,
If you want to display the formatted text in a cell then subscribe the QueryCellFormattedText event and set the e.Text to your new formatted value and then set e.Handled to TRUE to cancel default format. Here is a code snippet to show this
private void TableModel_QueryCellFormattedText(object sender, GridCellTextEventArgs e)
{
GridTableCellStyleInfo style = e.Style as GridTableCellStyleInfo;
Element el = style.TableCellIdentity.DisplayElement;
if( el.Kind == DisplayElementKind.Record
&& style.TableCellIdentity.Column != null
&& style.TableCellIdentity.Column.Name == "ID" )
{
if( e.Style.Text == "0" )
e.Text = "Welcome";
else
e.Text = string.Format("{0:000000.##}",e.Style.CellValue);
e.Handled = true;
}
}
Best regards,
Haneef