From server code you could use ClientScriptManager.GetPostBackEventReference which renders out a postback event reference heres a link on msdn http://msdn.microsoft.com/en-us/library/system.web.ui.page.getpostbackeventreference.aspx
heres a sample
Allows selecting gridview row without select column.
protected override void Render(HtmlTextWriter writer)
{
GridView g = GridView1;
foreach (GridViewRow r in g.Rows)
{
if(DataControlRowType.DataRow == r.RowType)
{
r.Attributes["onMouseOver"] = "this.style.cursor='pointer';this.style.cursor='hand'";
r.Attributes["OnClick"] = ClientScript.GetPostBackEventReference(g, "Select$" + r.RowIndex, true);
}
}
base.Render(writer);
}
almog.ori
2009-06-10 14:10:43