Change the returned rows in a gridview

O

Oystein@Norway

Hi!
I've got a DropDownlist with predefined numbers(5,10,15,20 etc.) which I
want to do a postback to the GridView pagesize, so that the user manually can
change returned rows. Is there a way to do that in the properties of the
Designview or must there be a code behind. If so, what is the code for this?

"Learn by doing, do by asking;)"
 
B

Bob Barrows [MVP]

Oystein@Norway said:
Hi!
I've got a DropDownlist with predefined numbers(5,10,15,20 etc.)
which I want to do a postback to the GridView pagesize, so that the
user manually can change returned rows. Is there a way to do that in
the properties of the Designview or must there be a code behind. If
so, what is the code for this?

Given that there is a postback, it is reasonable to assume there has to be
some server-side code to handle the postback ... The code is as simple as:

gridview1.pagesize=dropdownlist1.selectedvalue




There was no way for you to know it (except maybe by browsing through some
of the previous questions in this newsgroup before posting yours - always a
recommended practice) , but this is a classic asp newsgroup. ASP.Net bears
very little resemblance to classic ASP so, while you may be lucky enough to
find a dotnet-knowledgeable person here who can answer your question, you
can eliminate the luck factor by posting your question to a group where
those dotnet-knowledgeable people hang out. I suggest
microsoft.public.dotnet.framework.aspnet.
 
O

Oystein@Norway

Thanx, I'll remember that:)

Bob Barrows said:
Given that there is a postback, it is reasonable to assume there has to be
some server-side code to handle the postback ... The code is as simple as:

gridview1.pagesize=dropdownlist1.selectedvalue




There was no way for you to know it (except maybe by browsing through some
of the previous questions in this newsgroup before posting yours - always a
recommended practice) , but this is a classic asp newsgroup. ASP.Net bears
very little resemblance to classic ASP so, while you may be lucky enough to
find a dotnet-knowledgeable person here who can answer your question, you
can eliminate the luck factor by posting your question to a group where
those dotnet-knowledgeable people hang out. I suggest
microsoft.public.dotnet.framework.aspnet.


--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top