Page Index Issue
Page Index Issue
Page Index Issue
Page Index Issue
Page Index Issue
Page Index Issue Page Index Issue Page Index Issue Page Index Issue Page Index Issue Page Index Issue Page Index Issue Page Index Issue
Page Index Issue Page Index Issue
Page Index Issue
Go Back  Xtreme Visual Basic Talk > > > Page Index Issue


Reply
 
Thread Tools Display Modes
  #1  
Old 01-26-2011, 07:51 PM
youngsc youngsc is offline
Centurion
 
Join Date: Oct 2008
Posts: 121
Default Page Index Issue


I've got the following code setup in the page index changing event

GridView.PageIndex = e.NewPageIndex
GridView.DataBind()

It appears to work however it doesn't work correctly. When I click to go to the next page it displays the content in the EmptyDataTemplate rather than the next page. However if I force another postback it displays the next page. It seems like this was working fine, any ideas as to what may be causing this? I've got the page indexing set to true, autogenerate columns is false, can't think of much else. I'm also manually binding the data by a dataset to the datagridview.

TIA
Reply With Quote
  #2  
Old 01-26-2011, 08:17 PM
youngsc youngsc is offline
Centurion
 
Join Date: Oct 2008
Posts: 121
Default

I wasn't sure if I was describing it that great so I did a quick and dirty screen capture of the problem if they might help someone to identify the solution for me.

http://s126.photobucket.com/albums/p...iewProblem.mp4

BTW, I didn't restrict the rest of my album so feel free to check out the car or redneck ac I put together lol
Reply With Quote
  #3  
Old 01-26-2011, 08:59 PM
youngsc youngsc is offline
Centurion
 
Join Date: Oct 2008
Posts: 121
Default

I keep replying to my own thread but I'm finding more to possibly narrow it down further. It seems the problem is exclusive to the one page. I have a datagridview on a different page and am retrieving data the exact same way and the paging is working fine. The code is identical by the way. I also tried recreating the error page to a new one with the same content and it's still producing the undesired result.
Reply With Quote
  #4  
Old 01-26-2011, 09:43 PM
youngsc youngsc is offline
Centurion
 
Join Date: Oct 2008
Posts: 121
Default

OK final reply in case anyone else comes across this issue. It appears the "pump has to be primed" in other words the datagridview needs to have the datasource loaded at page load. Once that was done it's working fine.
Reply With Quote
  #5  
Old 01-30-2011, 08:41 PM
youngsc youngsc is offline
Centurion
 
Join Date: Oct 2008
Posts: 121
Default

Well I was mistaken. It worked for a day and now it's not again. I've got other pages in this project that utilize the same code and setup and they work fine but on two pages it doesn't. I would appreciate any ideas anyone can provide me.
Reply With Quote
  #6  
Old 06-02-2011, 08:39 AM
alexsts alexsts is offline
Freshman
 
Join Date: Apr 2010
Posts: 32
Default

From those 2 lines of code there is no way to tell what is wrong with that page.
Place a cs file in attachment that would give you a chance to get help.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Page Index Issue
Page Index Issue
Page Index Issue Page Index Issue
Page Index Issue
Page Index Issue
Page Index Issue Page Index Issue Page Index Issue Page Index Issue Page Index Issue Page Index Issue Page Index Issue
Page Index Issue
Page Index Issue
 
Page Index Issue
Page Index Issue
 
-->