Hi there,
I am facing a typical problem here. I have a page Reports.aspx which has a gridview containing a Select All checkbox in the header section. This page also contains a search section which comes from a master page (master page which contains the page Reports.aspx).
On my Page_Load event, this line of code is always fired
gvStudyList.RowDataBound += new GridViewRowEventHandler(gvStudyList_RowDataBound);
And in the gvStudyList_RowDataBound event i am setting the javascript function for the Select All checkbox as follows:
private void gvStudyList_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Header)
{
CheckBox chkBox = e.Row.Cells[1].Controls[0] as CheckBox;
if (chkBox != null)
{
chkBox.Attributes.Add("onclick", "javascript:SelectAll('" + chkBox.ClientID + "');");
}
}
}
The issue is that whenever i use the search functionality to filter the grid.
I am binding the grid using a session variable coming from the master page.
But my RowDataBound event does not get fired.
Can someone please help me with this issue? I need a solution asap due to urgent deliverable.
Thanks in advance.
I am facing a typical problem here. I have a page Reports.aspx which has a gridview containing a Select All checkbox in the header section. This page also contains a search section which comes from a master page (master page which contains the page Reports.aspx).
On my Page_Load event, this line of code is always fired
gvStudyList.RowDataBound += new GridViewRowEventHandler(gvStudyList_RowDataBound);
And in the gvStudyList_RowDataBound event i am setting the javascript function for the Select All checkbox as follows:
private void gvStudyList_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Header)
{
CheckBox chkBox = e.Row.Cells[1].Controls[0] as CheckBox;
if (chkBox != null)
{
chkBox.Attributes.Add("onclick", "javascript:SelectAll('" + chkBox.ClientID + "');");
}
}
}
The issue is that whenever i use the search functionality to filter the grid.
I am binding the grid using a session variable coming from the master page.
But my RowDataBound event does not get fired.
Can someone please help me with this issue? I need a solution asap due to urgent deliverable.
Thanks in advance.