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.
Hi
I want my grid to be static, because the user must not edit nor select any content on the cells, and at the same time i have columns that show currency numbers.
I have tried:
Grid.TableStyle.CellType = "Static"
Grid.TableStyle.CellType = "Currency"
but I only can assign one of those values at the same time.
How can i make a cell static and, at the same time show its value in currency format?
ADAdministrator Syncfusion Team June 6, 2006 12:46 PM UTC
Hi Roberto,
There is no built-in support for this. You need to handle the DrawCellDisplayText event for coverting the display text to currency formated text. Here is a code snippet.
this.gridControl1.TableStyle.CellType = "Static";
this.gridControl1.TableStyle.CellValue = 45.02;
private void gridControl1_DrawCellDisplayText(object sender, Syncfusion.Windows.Forms.Grid.GridDrawCellDisplayTextEventArgs e)
{
if(e.RowIndex > 0 && e.ColIndex > 0)
{
if( e.DisplayText != null && e.DisplayText != string.Empty )
{
double d = double.Parse(e.DisplayText);
e.DisplayText = string.Format("{0:C}",d);
}
}
}
Let me know if you need any further assistance.
Best Regards,
Haneef