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

Highlight an item in a row & column

4 Answers 48 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 10 Sep 2008, 01:45 PM
Can you highlight or change the font color of a single row item?  Not the whole row but a column in a row.  Something like the example below

column1     column 2        column 3
row 1            x                    x
row 2            x                    x
row 3            x                    x

Thanks!

4 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 10 Sep 2008, 02:17 PM
Hello George,

The following link could give you an idea:
Selecting cells

Kind regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Mike
Top achievements
Rank 1
answered on 10 Sep 2008, 02:20 PM
But I want to change the color in the code behind on ItemDataBound
0
Accepted
Shinu
Top achievements
Rank 2
answered on 10 Sep 2008, 02:24 PM

Hello George,

You can try out the following code to set the color for an item.
cs:

protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)   
    {   
        if (e.Item is GridDataItem)   
        {   
            GridDataItem dataItem = (GridDataItem)e.Item;             
   
            if (dataItem["Category"].Text == "Text")   
               {   
                dataItem["Category"].BackColor = System.Drawing.Color.Red;   
               }   
        }   
   }   
 

Shinu

0
Mike
Top achievements
Rank 1
answered on 10 Sep 2008, 02:27 PM
That's the Ticket!!!

Thank you Shinu!
Tags
Grid
Asked by
Mike
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Mike
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or