Highlighting and navigation for GridView Control





1.00/5 (1 vote)
Navigation: protected void GVEmployees_RowCreated(object sender, GridViewRowEventArgs e){ if(e.Row.RowType==DataControlRowType.DataRow) { e.Row.Attributes["onclick"] = "location.href='YourPage.aspx?id=" + ...
Navigation:
protected void GVEmployees_RowCreated(object sender, GridViewRowEventArgs e) { if(e.Row.RowType==DataControlRowType.DataRow) { e.Row.Attributes["onclick"] = "location.href='YourPage.aspx?id=" + DataBinder.Eval(e.Row.DataItem, "DataColumnNameOfYourGridView") + "'"; } }Highlighting:
protected void GVEmployees_RowCreated(object sender, GridViewRowEventArgs e) { if(e.Row.RowType!=DataControlRowType.Header || e.Row.RowType!=DataControlRowType.Footer) { e.Row.Attributes.Add("onmouseout", "this.className='normalRow'"); e.Row.Attributes.Add("onmouseover", "this.className='highlightRow'"); } }