Calling javascript in GridView RowCreated Event

//This junk of code is used to call javascript in GridView RowCreated Event

protected void grdIssue_RowCreated(object sender, GridViewRowEventArgs e)
{
CheckBox chkHead = new CheckBox();
if (e.Row.RowType.ToString().Trim() == "Header")
{
chkHead = (CheckBox)e.Row.FindControl("chkbxHeader");
chkHead.Attributes.Add("onClick", "chkBocHeader(" + chkHead.ClientID + ",'H')");
}
else if (e.Row.RowType.ToString().Trim() == "DataRow")
{
CheckBox chkRow = new CheckBox();
chkRow = (CheckBox)e.Row.FindControl("chkboxRow");
chkRow.Attributes.Add("onClick", "chkBocHeader(this,'R')");
}
}

No comments: