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

Cell Color

2 Answers 57 Views
GridView
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 06 Sep 2011, 09:29 PM
New to Silverlight and need to get a quick demo done. I'm using the RadGridview to dispaly some dynamic data. The column header are dynamic in the grid. I need to be able to change the background color of a cell. This is a demo / throw away code and wondered if there was an easy way to do this with out a style template. I have a fixed condidtion where I would like to be able to change the color of row 3 cell 5 to red. Is there an easy way to do this?

2 Answers, 1 is accepted

Sort by
0
Karthikeyan
Top achievements
Rank 1
answered on 07 Sep 2011, 02:50 AM
Hi James,

You can try for the following code,

radGridView1.ColumnFromDisplayIndex(2).Background = new SolidColorBrush(Colors.Red);

Hope it helps.
Please mark as answer if solves the issue.

Thanks,
Karthikeyan Manickam.
0
Maya
Telerik team
answered on 07 Sep 2011, 06:55 AM
Hello James,

I would recommend you to use a CellStyleSelector. Working with it, you will be able quite easily to define a specific background depending on the condition you want. Please take a look at our online documentation and demos for a reference. 


Regards,
Maya
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
GridView
Asked by
James
Top achievements
Rank 1
Answers by
Karthikeyan
Top achievements
Rank 1
Maya
Telerik team
Share this question
or