The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I am using GGC. I am binding the entity collection to the grid. Grid contains some numeric columns having sales figures. User Requirement is- When user select the formatting option as £K then i have to show values /1000 but my data source values should not get changed to /1000. I just need to change display text in cell to cell value/1000 keeping binded cell value as it is. Is this possible in the GGC. Is there any property which store the formated text without changing the actual cell value..? Please help. Thanks Harshad
HAhaneefm Syncfusion Team May 29, 2007 05:23 PM UTC
Hi Harshad,
If you just want to format the text that is displayed, you can handle the TableControlDrawCellDisplayText and set e.DisplayText there to easily control what text is drawn in the cell.
I tried the event but my cell is editable so when user click on the cell to edit the value ,cell display original value and not the formatted one. What i want to do is user will enter value and i have to save the value *1000 in the datasource and in cell value will not be *1000. This is bounded column. Please tell me how to do this. I always need to show value /1000 in the editable cell.
HAhaneefm Syncfusion Team July 9, 2007 10:07 PM UTC
Hi Harshad.
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
void TableModel_QueryCellFormattedText(object sender, Syncfusion.Windows.Forms.Grid.GridCellTextEventArgs e) { if (e.Style.CellType == "Currency") { if (e.Style.CellValue != null && e.Style.CellValue.ToString() != string.Empty) { double d; double.TryParse(e.Style.CellValue.ToString(), out d); e.Text = string.Format("£{0}", d / 1000); e.Handled = true; } } }