S
settyv
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, DataGridPageChangedEventArgs e)
{
Control ctl=new Control() ;
if (ctl.ID.ToString() == "grdCaseSearch" )
{
grdCaseSearch.CurrentPageIndex = e.NewPageIndex;
DisplayCaseSearchResults();
}
else if (ctl.ID.ToString() == "grdCalSearch" )
{
grdCalSearch.CurrentPageIndex = e.NewPageIndex;
DisplayCalendarSearchResults ();
}
}
<asp:datagrid id="grdCaseSearch" PagerStyle-PrevPageText="Previous"
PagerStyle-NextPageText="Next" PagerStyle-Mode="NextPrev"
OnPageIndexChanged="NewPage" AllowPaging="True"
Headerstyle-BackColor="#ccccff " Runat="server"></asp:datagrid>
<asp:datagrid id="grdCalSearch" PagerStyle-PrevPageText="Previous"
PagerStyle-NextPageText="Next" PagerStyle-Mode="NextPrev"
OnPageIndexChanged="NewPage" AllowPaging="True"
Headerstyle-BackColor="#ccccff " Runat="server"></asp:datagrid>
Thanks,
Vishnu
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, DataGridPageChangedEventArgs e)
{
Control ctl=new Control() ;
if (ctl.ID.ToString() == "grdCaseSearch" )
{
grdCaseSearch.CurrentPageIndex = e.NewPageIndex;
DisplayCaseSearchResults();
}
else if (ctl.ID.ToString() == "grdCalSearch" )
{
grdCalSearch.CurrentPageIndex = e.NewPageIndex;
DisplayCalendarSearchResults ();
}
}
<asp:datagrid id="grdCaseSearch" PagerStyle-PrevPageText="Previous"
PagerStyle-NextPageText="Next" PagerStyle-Mode="NextPrev"
OnPageIndexChanged="NewPage" AllowPaging="True"
Headerstyle-BackColor="#ccccff " Runat="server"></asp:datagrid>
<asp:datagrid id="grdCalSearch" PagerStyle-PrevPageText="Previous"
PagerStyle-NextPageText="Next" PagerStyle-Mode="NextPrev"
OnPageIndexChanged="NewPage" AllowPaging="True"
Headerstyle-BackColor="#ccccff " Runat="server"></asp:datagrid>
Thanks,
Vishnu