This is a migrated thread and some comments may be shown as answers.

Format Individual Cells of RadGrid

1 Answer 99 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Denis
Top achievements
Rank 1
Denis asked on 10 Dec 2015, 08:13 PM

Hello,

 

I have an application which deliver data from a SQL query in the form of a RadGrid.  I have business rules that require me to high cells red or green. Whether the cells are red or green is stored in the DB.  I also need to hyperlink from cells to a URL.

 

But each cell will have it own URL and it own color.  So the formatting either needs to be done after the RadGrid is populated by iterating through each cells, or we need to pass more data than just what values are displayed in the Grid, so that the Grid has the information to do the formatting.

 

I hope that is clear.  TIA.

Denis Burke

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 14 Dec 2015, 01:25 PM
Hi Denis,


If you would like to have conditional format of the cells in RadGrid you can use the ItemDataBound event. In the handler you can check what is the value in specific  cell and set the style for it according to your requirements. Check out the following article that illustrates the approach:




Regards,
Viktor Tachev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Denis
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or