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 a simple question but I haven''t been able to find the answer or a sample in the documentation. I would like to format an entire floating point column of data coming from a DataSet in a GridDataBoundGrid. For instance, I would like to round the numbers for an entire column to 2 decimals and put commas in for every third digit left of the decimal point ( ie 5,232,233.54 ). Can someone point me in the right direction or show an example of how to do this?
Thanks,
Dan
Hey Dan,
You can just change the cell type for the columns in your databound grid. For example...
this.grdAppointments.Binder.InternalColumns[1].StyleInfo.CellType = "Static";
Search in the ".NET style documentation" for CellType. This will give you the list you are looking for. For your specific cell type, you could use NumericUpDown, Currency, MaskedEdit, or even Static(if you format you value before you set it).
Cheers,
JF
ADAdministrator Syncfusion Team December 1, 2003 04:49 PM UTC
In addition to setting the CellType property,
this.grdAppointments.Binder.InternalColumns[1].StyleInfo.CellType
as Jim mentioned, you can also set the Format property and the CellValueTyle property.
this.grdAppointments.Binder.InternalColumns[1].StyleInfo.Format = "#.####"; //or "F4" or ???
this.grdAppointments.Binder.InternalColumns[1].StyleInfo.CellValueType = typeof(double)