Skip to content

Instantly share code, notes, and snippets.

@tkMageztik
Created April 13, 2016 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tkMageztik/8961c4c3001704ab9f51f35d559c92da to your computer and use it in GitHub Desktop.
Save tkMageztik/8961c4c3001704ab9f51f35d559c92da to your computer and use it in GitHub Desktop.
Para darle color a las filas de un gridview en el databound, entre otros formatos ...
//e.Row.Attributes.Add("style", "cursor:help;");
//if (e.Row.RowType == DataControlRowType.DataRow && e.Row.RowState == DataControlRowState.Alternate)
//{
// if (e.Row.RowType == DataControlRowType.DataRow)
// {
// e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='orange'");
// e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#E56E94'");
// e.Row.BackColor = Color.FromName("#E56E94");
// //#fafad2
// }
//}
//else
//{
// if (e.Row.RowType == DataControlRowType.DataRow)
// {
// e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='orange'");
// e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='gray'");
// e.Row.BackColor = Color.FromName("gray");
// }
// //e.Row.Cells[0].BackColor = Color.FromName("gray");
// //e.Row.Cells[1].BackColor = Color.FromName("gray");
// //e.Row.Cells[2].BackColor = Color.FromName("gray");
// //e.Row.Cells[3].BackColor = Color.FromName("gray");
// //e.Row.Cells[4].BackColor = Color.FromName("gray");
// //e.Row.BorderWidth = 2;
// //e.Row.BorderColor = Color.FromName("#43C6DB");
//}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment