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 have datatable that I am using to populate a databound grid. I need to set a thousand seperator on one column and limit the number digits after the decimal in three other columns. How can I do this?
ADAdministrator Syncfusion Team July 27, 2004 12:58 PM UTC
For the GridBoundColumn, you can set the style.CellValueType and style.Format to control the display of numbers.
GridStyleInfo style = grid.Binder.InternalColumns["SomeCol"].StyleInfo;
style.CellValueType = typeof(double);
style.Format = "#,###.###"; //comma plus 3 dec places
If you have explicitly added GridBoundColumns, then you get the column from teh grid.GridBoundColumns collection instead of the binder.InternalColumns.
To not see a comma, and have 3 optional decimal places, try "#.###". Or to have 3 required places, try "#.000"