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 override QueryCellInfo() in my custom GridControl class which inherits from Syncfusion.Windows.Forms.Grid.GridControl. I was trying to change the text alignment as the default setting is left-aligned. My code is as below,
But the code does not seem to take effect and the text alignment in grid cells is still the same as default left-aligned.
The second question is that if I only want to show 2 digits after decimal point for double values. How do I do it? Also how can I show '123456789' as '123,456,789'?
Thanks a lot for your great help and I really appreciate for your time.
Your help is always timely and informational. What you suggested does achieve the purpose.
Btw, is there anyway to show '123456789' as '123,456,789'?
Thanks again!
ADAdministrator Syncfusion Team March 21, 2007 05:08 PM UTC
Hi Yifei,
Thank you for your update.
You can set the Style.Format property to achieve this behavior
//QueryCellInfo event e.Style.CellValueType = typeof(double); e.Style.CellValue =123456789d; e.Style.Format = "##,##"; //use this format "##,##.00" to show 2 decimal points.
Please refer to the TextFormat browse sample that shows you "how to format the data in your grid?" [install drive]:Syncfusion\Essential Studio\4.4.0.49\windows\Grid.Windows\Samples\Appearance\TextFormat\cs