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

Want to change the color of the cell when value changes

1 Answer 53 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Syed
Top achievements
Rank 1
Syed asked on 03 May 2009, 06:05 AM
Hi,

I want to change the color of the cell whenever the value is changing in the cell.

Example:

if row(n)cell(n) value > 90
cell color = red
else if row(n)cell(n) >60 and <90
cell color=blue
else
cell color=gray
end if

Thanks.

Regards
Arshad

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 04 May 2009, 03:29 AM
Hi Syed,

Check out the following help article for getting more details about how to access RadGrid cells using the column's UniqueName property.
Accessing cells and rows

You can alter the logic applied here
 

 protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) 
    { 
        if (e.Item is GridDataItem) 
        { 
            GridDataItem item = (GridDataItem)e.Item; 
            if (Convert.ToInt32( item["columnUniqueName"].Text)>90) 
            { 
                item["columnUniqueName"].ForeColor = System.Drawing.Color.Blue; 
            } 
        } 
  } 


Shinu
Tags
Grid
Asked by
Syed
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Share this question
or