Javascript:
Cita:
C#:function On(GridView) {
if (GridView != null) {
GridView.originalBgColor = GridView.style.backgroundColor;
GridView.style.backgroundColor = "#D2D6DC"; // - #FE6700
GridView.style.cursor = "hand";
}
}
function Off(GridView) {
if (GridView != null) {
GridView.style.backgroundColor = GridView.originalBgColor;
}
}
if (GridView != null) {
GridView.originalBgColor = GridView.style.backgroundColor;
GridView.style.backgroundColor = "#D2D6DC"; // - #FE6700
GridView.style.cursor = "hand";
}
}
function Off(GridView) {
if (GridView != null) {
GridView.style.backgroundColor = GridView.originalBgColor;
}
}
Cita:
El problema esta cuando tengo la fila seleccionada y tengo que deseleccionarla para que el gridview quede igual. protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("OnMouseOver", "On(this);");
e.Row.Attributes.Add("OnMouseOut", "Off(this);");
e.Row.Attributes["OnClick"] = Page.ClientScript.GetPostBackClientHyperlink(GridV iew1, "Select$" + e.Row.RowIndex);
}
}
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("OnMouseOver", "On(this);");
e.Row.Attributes.Add("OnMouseOut", "Off(this);");
e.Row.Attributes["OnClick"] = Page.ClientScript.GetPostBackClientHyperlink(GridV iew1, "Select$" + e.Row.RowIndex);
}
}
Espero que me ayuden, adios, gracias.