473,503 Members | 1,633 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Gridview paging problem

Hello,

I've run across problem with paging in gridview.
I have 2 elementson my web page - drop down list filled with manufacturers
and grid view for displaying data connected with certain manufacturer. For
test purposes I've set PageSize property of gridview to 5.
When I am loading page I initialy fill gridview with first manufacturer on
the list (this manufacturer have i.e. 9 records in database).
As far I can use paging mechanism.
Now I'am changing manufacturer on drop down list to second one, which fills
grid view with second manufacturer. This manufacturer have 12 records in
database what gives 3 pages. First page works like a charm, but from now on
everything goes wrong.
If I choose next page it gives me results form second page of first
manufacturer! I can go back to first page, but it also shows results from
first manufacturer.
here is my code for displaying manufacturer on page load event:

strSQL="select * from mf where id_mf=" + DDL_mf.Items[0].Value.ToString();
cmdSQL.Commandtext=strSQL;
cmdSQL.Connection=connSQL;
sdaSQL.SelectCommand=cmdSQL;
sdaSQL.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();

and code from DDL_mf_SelectedIndexChanged:
strSQL="select * from mf where id_mf=" + DDL_mf.SelectedValue;
cmdSQL.Commandtext=strSQL;
cmdSQL.Connection=connSQL;
sdaSQL.SelectCommand=cmdSQL;
sdaSQL.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();

Please help ... :)
Krzysztof Stefan
Apr 19 '07 #1
0 1104

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

Similar topics

0
2706
by: ck388 | last post by:
For some reason when I enable the callback feature of the gridview I still get a page refresh, that is it seems like there is a postback that occurs, not a callback which is just supposed to update...
8
18067
by: Greg Lyles | last post by:
Hi all, I'm trying to develop an ASP.NET 2.0 website and am running into some real problems with what I thought would be a relatively simple thing to do. In a nutshell, I'm stuck on trying to...
9
15750
by: =?Utf-8?B?c3Jpbml2YXM=?= | last post by:
Hi All, Can anybody please help me, how to access all rows in a grid view if the paging is enabled? If gridview contains 100 rows and pagecount=10, then in the gridview.rows collection, i'm...
3
2178
by: Marc Grutte | last post by:
Hi I am trying to bind a custom datasource to a gridview whilst paging is enabled. What is missing in this code to make the paging + binding work? thanks M <%@ Page Language="VB" %>
2
13160
by: antonyliu2002 | last post by:
I've been googling for some time, and could not find the solution to this problem. I am testing the paging feature of gridview. I have a very simple web form on which the user can select a few...
5
2966
by: Andrew Robinson | last post by:
I am attempting to better automate a Pager Template within a GridView. I am succesfully skinning a Drop Down List withing my control (the DDL is added to my control). I correctly populate the item...
0
1983
by: Don Miller | last post by:
Here is an example of what I believe is a bug in ASP.NET 2.0 GridView paging without postbacks (or at least not documented how to fix it). Once the GridView is displayed, clicking on any of the...
4
2712
by: Don Miller | last post by:
This is a repost of a reproducible problem/bug with GridView with dynamic SQL and binding. Is there a better ASP.NET newsgroup I should post to where MS techs or MVPs take an interest in such...
4
8808
by: Peter | last post by:
I want to call a JavaScript on PageIndexChanged event, how do I do that? Thank You Peter
0
1222
by: Jeff | last post by:
hi there ;) asp.net 2.0 I'm having problem with paging in GridView, I'm using custom paging. The ObjectDataSource reads in the rows needed for displaying each page as each page is selected....
0
7202
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,...
0
7086
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...
0
7280
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7332
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...
1
6991
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...
0
7462
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...
0
5578
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,...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
1512
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 ...

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.