I would like to put DataFormat on a cell level in a batch grid.
Jobs # 5
Unemployment 3.25%
What is the best way?
1 Answer, 1 is accepted
0
Attila Antal
Telerik team
answered on 27 Oct 2023, 03:44 PM
Hi David,
To format how data appears in the cell, you will need to use the DataFormatString property and apply a format from the Standard Numeric Format specifier.
The following example will display the Numeric values as percentages with 2 decimal digits.
Maybe, i didn't explain my problem in best manner. i need different, conditional format for some rows.
I tried on ItemDataBound, but could not make it perfect.
Ideas?
Attila Antal
Telerik team
commented on 30 Oct 2023, 12:32 PM
ItemDataBodund event is the one that is triggered for each row and when the data is available. If you want to apply conditional formatting for the rows based on their data, ItemDataBound is the way to go.
To format a value, access the Cell, then the cell's value, format is as needed and set the Cell's Text property with the formatted value.
The following documentation shows using the APIs to do that, see Accessing Cells