Click here to Skip to main content
14,775,260 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Sorry ,i want in Datagrid (and not GridView)

I have one radiobuttonlist filled that remarks select option [ok] or [notok], now i want bgcolor when radiobuttonlist select values [notok]...

when record save with [notok] then display data in Datagrid with this row backgroung color as Red.
Posted
Updated 18-May-10 3:57am
v2

See here.
   
Comments
Sandeep Mewara 18-May-10 8:55am
   
He wants for ASP.NET grid!
Please be clear from next time before posting the query!

Here you go:
//Something similar to this
protected void DataGrid_ItemDataBound(object sender, DataGridItemEventArgs e)
{
     CheckBox cbx = (CheckBox)e.Row.FindControl("checkBoxID");
     if (cbx != null)
     {
         if (cbx.Checked)
         {
            // This will change back color of the grid row
            e.Row.BackColor = System.Drawing.Color.Red;
         }
     }
}

Lastly, please read a book! Doing Google would had given you the difference of events immediately!
   
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900