and enable it to be selected by clicking the row:
protected void gv1_RowDataBound(object sender,
GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseover",
"this.style.cursor='hand'");
e.Row.Attributes.Add("onmouseout",
"this.style.cursor='cursor'");
}
}
protected void gv1_RowCreated(object sender,
GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onclick",
Page.ClientScript.GetPostBackEventReference(gv1, "Select$" +
Convert.ToString(e.Row.RowIndex)));
}
}
Enjoy.

No comments:
Post a Comment