Hi,
I have webform which has 4 Datagrid controls with (built-in
Pagination) and 4 search buttons to perform the search operation.When i
click on search operation it is displaying the results in grid .when i
click next it is telling error...Please let me know how to solve this
problem.
Below method can be used for all the datagrids.
protected void NewPage(object sender, DataGridPageCha ngedEventArgs e)
{
Control ctl=new Control() ;
if (ctl.ID.ToStrin g() == "grdCaseSea rch" )
{
grdCaseSearch.C urrentPageIndex = e.NewPageIndex;
DisplayCaseSear chResults();
}
else if (ctl.ID.ToStrin g() == "grdCalSear ch" )
{
grdCalSearch.Cu rrentPageIndex = e.NewPageIndex;
DisplayCalendar SearchResults ();
}
}
<asp:datagrid id="grdCaseSear ch" PagerStyle-PrevPageText="P revious"
PagerStyle-NextPageText="N ext" PagerStyle-Mode="NextPrev"
OnPageIndexChan ged="NewPage" AllowPaging="Tr ue"
Headerstyle-BackColor="#ccc cff " Runat="server"> </asp:datagrid>
<asp:datagrid id="grdCalSearc h" PagerStyle-PrevPageText="P revious"
PagerStyle-NextPageText="N ext" PagerStyle-Mode="NextPrev"
OnPageIndexChan ged="NewPage" AllowPaging="Tr ue"
Headerstyle-BackColor="#ccc cff " Runat="server"> </asp:datagrid>
Thanks,
Vishnu