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?
You can just change the cell type for the columns in your databound grid. For example...
this.grdAppointments.Binder.InternalColumns.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).
ADAdministrator Syncfusion Team December 1, 2003 04:49 PM UTC
In addition to setting the CellType property,
as Jim mentioned, you can also set the Format property and the CellValueTyle property.
this.grdAppointments.Binder.InternalColumns.StyleInfo.Format = "#.####"; //or "F4" or ???
this.grdAppointments.Binder.InternalColumns.StyleInfo.CellValueType = typeof(double)