Ask a Question related to ASP.NET Data Grid Control, Design and Development.
-
Verdict #1
Paging problem
Hi
My form includes a dropdown list(DL) that represent types of customers and
submit button(BTN).
When I press the BTN it runs a query related to the selected DL and fills a
datagrid that supports pagination.
The problem is that if I go to page 15 for example and then replace my DL to
another type and submit again, if the other type doesn't have 15 pages as
well, I get error message:
Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount
I tried to reset my datagrid for every BTN pressing by using :
dgSearch.CurrentPageIndex = 0
dgSearch.DataBind()
Any help is appreciated!
Verdict Guest
-
Recordset paging problem
I'm stuck on this one My recordset paging wont work. I've done a search page with a form and a table in it to post 2 values to the result page.... -
Datagrid Paging Problem
Hi I have 2 linked datagrids on a web page, a master and a detail. Both are set as paged. The first contains accounts and the second contains the... -
another problem with paging
I am having the same problem, How did you solve your problem? I can't open the first link in BalaKrishna's posting and i couldn't find the answer... -
Repeater paging problem
Hi, I'm trying to do the following but I can't understand what's wrong. Could you help me here! I do paging with a Repeater like this: ... -
Problem with paging
I found the solution to that problem ... check if you have then datagrid property DataKeyField defined in your aspx page. Ex: DataKeyField="ID"... -
Jeff Thur #2
Paging Problem
I have a SQL Stored Procedure returning a dataset. When
paging is turned off I get the entire dataset on one long
page. However when paging is turned on, I get the first
page and when I go to the next page I get the same data
on page 2. In other words paging is not working for me.
Thanks in advance for any suggestions.
This is my code:
DS = new DataSet()
MyCommand.Fill(DS, "Results")
DataGrid1.DataSource=DS.Tables
("Results").DefaultView
DataGrid1.DataBind()
Jeff Thur Guest
-
Elton Wang #3
Paging Problem
Check out following url
[url]http://msdn.microsoft.com/library/default.asp?[/url]
url=/library/en-
us/dv_vbCode/html/vbtskcodepagingindatagridwebcontrolvisual
basic.asp
HTH
Elton Wang
[email]elton_wang@hotmail.com[/email]
>-----Original Message-----
>I have a SQL Stored Procedure returning a dataset. When
>paging is turned off I get the entire dataset on one long
>page. However when paging is turned on, I get the first
>page and when I go to the next page I get the same data
>on page 2. In other words paging is not working for me.
>Thanks in advance for any suggestions.
>
>
>This is my code:
>
> DS = new DataSet()
> MyCommand.Fill(DS, "Results")
>
>
>
>
>
> DataGrid1.DataSource=DS.Tables
>("Results").DefaultView
> DataGrid1.DataBind()
>
>.
>Elton Wang Guest
-
Andrea Williams #4
Paging problem
I have a datagrid that only shows 2 items per page. The page numbers appear
at the bottome of each page for the user to page through the list. It shows
1 through 10 and then a "..." link. If I click the "..." link I can see
page numbers 11 through 20 and another "..." link. However if I cllick that
link, it sends me back to the first 1 through 10 pages instead of 21 through
30. I know there are enough items that 34 pages should show up. So what is
the problem?
also, any of the numbers that I click from 11 to 20 send me back to the
corresponding number in the 1 through 10 pages... It seems like it's not
returning the correct numbers to the paging handler...
Code is as follows:
private void DataGrid1_PageIndexChanged(object source,
System.Web.UI.WebControls.DataGridPageChangedEvent Args e)
{
this.DataGrid1.CurrentPageIndex = e.NewPageIndex;
if (this.mdsDataSource != null)
this.DataGrid1.DataBind();
}
Andrea Williams Guest
-
Elton Wang #5
Paging problem
Hi Andrea,
Probably the EnableViewState of your datagrid is false. If
so, change it to true.
HTH
Elton Wang
[email]elton_wang@hotmail.com[/email]
page numbers appear>-----Original Message-----
>I have a datagrid that only shows 2 items per page. Thethe list. It shows>at the bottome of each page for the user to page throughlink I can see>1 through 10 and then a "..." link. If I click the "..."However if I cllick that>page numbers 11 through 20 and another "..." link.instead of 21 through>link, it sends me back to the first 1 through 10 pagesshow up. So what is>30. I know there are enough items that 34 pages shouldme back to the>the problem?
>
>also, any of the numbers that I click from 11 to 20 sendseems like it's not>corresponding number in the 1 through 10 pages... It>returning the correct numbers to the paging handler...
>
>Code is as follows:
>
>private void DataGrid1_PageIndexChanged(object source,
>System.Web.UI.WebControls.DataGridPageChangedEven tArgs e)
>
>{
>
>this.DataGrid1.CurrentPageIndex = e.NewPageIndex;
>
>if (this.mdsDataSource != null)
>
>this.DataGrid1.DataBind();
>
>}
>
>
>
>
>.
>Elton Wang Guest
-
Andrea Williams #6
Re: Paging problem
That's not it, it's already set to true by default and I have not changed
it.
Andrea
"Elton Wang" <anonymous@discussions.microsoft.com> wrote in message
news:01b401c53969$fa557120$a601280a@phx.gbl...> Hi Andrea,
>
> Probably the EnableViewState of your datagrid is false. If
> so, change it to true.
>
> HTH
>
> Elton Wang
> [email]elton_wang@hotmail.com[/email]
>
>> page numbers appear> >-----Original Message-----
> >I have a datagrid that only shows 2 items per page. The> the list. It shows> >at the bottome of each page for the user to page through> link I can see> >1 through 10 and then a "..." link. If I click the "..."> However if I cllick that> >page numbers 11 through 20 and another "..." link.> instead of 21 through> >link, it sends me back to the first 1 through 10 pages> show up. So what is> >30. I know there are enough items that 34 pages should> me back to the> >the problem?
> >
> >also, any of the numbers that I click from 11 to 20 send> seems like it's not> >corresponding number in the 1 through 10 pages... It> >returning the correct numbers to the paging handler...
> >
> >Code is as follows:
> >
> >private void DataGrid1_PageIndexChanged(object source,
> >System.Web.UI.WebControls.DataGridPageChangedEven tArgs e)
> >
> >{
> >
> >this.DataGrid1.CurrentPageIndex = e.NewPageIndex;
> >
> >if (this.mdsDataSource != null)
> >
> >this.DataGrid1.DataBind();
> >
> >}
> >
> >
> >
> >
> >.
> >
Andrea Williams Guest
-
Andrea Williams #7
Re: Paging problem
Also, the paging works fine with the page 1 through 10.
Andrea
"Elton Wang" <anonymous@discussions.microsoft.com> wrote in message
news:01b401c53969$fa557120$a601280a@phx.gbl...> Hi Andrea,
>
> Probably the EnableViewState of your datagrid is false. If
> so, change it to true.
>
> HTH
>
> Elton Wang
> [email]elton_wang@hotmail.com[/email]
>
>> page numbers appear> >-----Original Message-----
> >I have a datagrid that only shows 2 items per page. The> the list. It shows> >at the bottome of each page for the user to page through> link I can see> >1 through 10 and then a "..." link. If I click the "..."> However if I cllick that> >page numbers 11 through 20 and another "..." link.> instead of 21 through> >link, it sends me back to the first 1 through 10 pages> show up. So what is> >30. I know there are enough items that 34 pages should> me back to the> >the problem?
> >
> >also, any of the numbers that I click from 11 to 20 send> seems like it's not> >corresponding number in the 1 through 10 pages... It> >returning the correct numbers to the paging handler...
> >
> >Code is as follows:
> >
> >private void DataGrid1_PageIndexChanged(object source,
> >System.Web.UI.WebControls.DataGridPageChangedEven tArgs e)
> >
> >{
> >
> >this.DataGrid1.CurrentPageIndex = e.NewPageIndex;
> >
> >if (this.mdsDataSource != null)
> >
> >this.DataGrid1.DataBind();
> >
> >}
> >
> >
> >
> >
> >.
> >
Andrea Williams Guest
-
Elton Wang #8
Re: Paging problem
Generally when paging you should re-bind datagrid with its
data source. I can't see anything else wrong.
HTH
Elton Wang
have not changed>-----Original Message-----
>That's not it, it's already set to true by default and Iin message>it.
>
>Andrea
>
>
>"Elton Wang" <anonymous@discussions.microsoft.com> wroteIf>news:01b401c53969$fa557120$a601280a@phx.gbl...>> Hi Andrea,
>>
>> Probably the EnableViewState of your datagrid is false.The>> so, change it to true.
>>
>> HTH
>>
>> Elton Wang
>> [email]elton_wang@hotmail.com[/email]
>>
>>>> >-----Original Message-----
>> >I have a datagrid that only shows 2 items per page.through>> page numbers appear>> >at the bottome of each page for the user to pagethe "...">> the list. It shows>> >1 through 10 and then a "..." link. If I clicksend>> link I can see>> However if I cllick that>> >page numbers 11 through 20 and another "..." link.>> instead of 21 through>> >link, it sends me back to the first 1 through 10 pages>> show up. So what is>> >30. I know there are enough items that 34 pages should>> >the problem?
>> >
>> >also, any of the numbers that I click from 11 to 20e)>> me back to the>> seems like it's not>> >corresponding number in the 1 through 10 pages... It>> >returning the correct numbers to the paging handler...
>> >
>> >Code is as follows:
>> >
>> >private void DataGrid1_PageIndexChanged(object source,
>> >System.Web.UI.WebControls.DataGridPageChangedEven tArgs>>> >
>> >{
>> >
>> >this.DataGrid1.CurrentPageIndex = e.NewPageIndex;
>> >
>> >if (this.mdsDataSource != null)
>> >
>> >this.DataGrid1.DataBind();
>> >
>> >}
>> >
>> >
>> >
>> >
>> >.
>> >
>
>.
>Elton Wang Guest
-
Hordur Hreinsson #9
RE: Paging problem
Hey,
I have the same problem. Very mysterious. It's the links with postback that have wrong postback information... When you are at the ... 11 12 ... 19 20 ... links then they have the same postback information as 1 2 ... 9 10 ... which means that if you press 11 it will go to page 2 if you press 15 it will go to page 6.
The question is, why does it generate the same postbacks in both places.
If you found the aswer please post it here.
Hördur.
From [url]http://www.developmentnow.com/g/12_2005_4_0_0_371810/Paging-problem.htm[/url]
Posted via DevelopmentNow.com Groups
[url]http://www.developmentnow.com[/url]
Hordur Hreinsson Guest



Reply With Quote

