473,783 Members | 2,376 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Urgent-Please help me.

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

Nov 1 '06 #1
2 1449
What is the exact error?

<se****@gmail.c omwrote in message
news:11******** **************@ i42g2000cwa.goo glegroups.com.. .
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

Nov 1 '06 #2
Sorry i saw this pretty late, don't know if you have got a solution, going
through your code i came over a couple of gotchas that could be issues,
since you
did not state the excat error you are getting

first the lines

Control ctl=new Control() ;
if (ctl.ID.ToStrin g() == "grdCaseSea rch" )

ctl would never be equal to "grdCaseSea rch"

maybe this is what you were trying to achieve :

protected void NewPage(object sender, DataGridPageCha ngedEventArgs e) {
DataGrid ctl= sender as DataGrid;
if ( ctl != null && (ctl.ID.ToStrin g() == "grdCaseSearch" ) ){
ctl.CurrentPage Index = e.NewPageIndex;
DisplayCaseSear chResults();
}
.....
}

secondly you might want to check to make sure that your NewPageIndex is not
greater than the size of the result set
vis

if (e.NewPageIndex >= ctl.PageSize)
{
ctl.CurrentPage Index = 0;
}
else
{
ctl.CurrentPage Index = e.NewPageIndex ;
}

hope these help, however if you post the errors you are getting it'll be a
lot easier tracking down what the problem is.

<se****@gmail.c omwrote in message
news:11******** **************@ i42g2000cwa.goo glegroups.com.. .
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

Nov 2 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1382
by: Johnson Ndiovu | last post by:
This is a multi-part message in MIME format --af4b847f-30bf-4b8d-acf1-2909de953a6e Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable DEAR FRIEND, BUSINESS TRANSACTION. MY NAME IS JOHNSON NDIOVU, THE ELDEST SON OF MR.AKUGA NDIOVU OF ZIMBAWE IT =
9
4317
by: Stefan Bauer | last post by:
Hi NG, we've got a very urgent problem... :( We are importing data with the LOAD utility. The input DATE field data is in the format DDMMYYYY (for days) and MMYYYY (for months). The target data format is european DD.MM.YYYY (for days) and 01.MM.YYYY (for months). The input format is not recognizable as a DATE input to a DB2 LOAD for
3
2278
by: gani | last post by:
hi, how to get the fullpath of created IsolatedStorage directory. thanks. -- gani
28
3068
by: Tamir Khason | last post by:
Follwing the struct: public struct TpSomeMsgRep { public uint SomeId;
16
2966
by: | last post by:
Hi all, I have a website running on beta 2.0 on server 2003 web sp1 and I keep getting the following error:- Error In: http://www.mywebsite.org/WebResource.axd?d=5WvLfhnJp5Lc8WhQSD4gdA2&t=632614619884218750 -------------------------------------------------------------------------------- System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed. at...
7
7259
by: zeyais | last post by:
Here is my HTML: <style> ..leftcolumn{float:left;width:300px;border: 1px solid #ccc} ..rtcolumn{float:left;width:600px;border: 1px solid #ccc} </style> <body> <div class="leftcolumn" id="d_links"> multiple <a href="hello.aspx?q=something">something</a><a href="hello.aspx?q=something1">something1</a><a
8
2786
by: ginnisharma1 | last post by:
Hi All, I am very new to C language and I got really big assignment in my work.I am wondering if anyone can help me.........I need to port compiler from unix to windows and compiler is written partially in c and partially in fortran. I guess i need to change host specific files to make it working. I wonder if standard header files are going to change in this case.my current windows compiler doesn't have sys/resource.h but unix compiler...
3
6476
by: N. Spiker | last post by:
I am attempting to receive a single TCP packet with some text ending with carriage return and line feed characters. When the text is send and the packet has the urgent flag set, the text read from the socket is missing the last character (line feed). When the same text is sent without the urgent flag set, all of the characters are read. I'm reading the data using the blocking read call of the network stream class. The .NET...
1
2128
by: rajesh.us.it.recruiter | last post by:
Hi Guys/Partners, We have a URGENT Requirement for Perl Programmer with H1 visa in India/US for one of our prestigious Client. Location : New Jersey Requirements : Should be very strong in Perl Should be strong in SQL, Unix, C++ Should have some knowledge in RDBMS
7
5991
by: Cirene | last post by:
I used to use the Web Deployment Project with my VS2005 projects. Now I've fully upgraded to VS2008. Do I have to download a new version of the Web Deployment Project? If so where can I find it? If not, how do I have to change my deployment strategy? Thanks!
0
9643
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10083
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9946
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8968
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5379
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4044
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.