Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

PortalWebHosting
  Ads  
Webhost4Life - $4.95 Windows Hosting
 


  Sponsors  

Meet Our Sponsors

The Official Microsoft ASP.NET Website
Portal Webhosting - Hosting For Developers
Red-Gate Software
MaximumASP
SourceGear - Tools for Developers
.: CounterSoft :.
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Trouble paging Gridview
Previous Previous
 
Next Next
New Post 12/11/2007 1:11 PM
User is offline pferril
22 posts
10th Ranked


Re: Trouble paging Gridview 

Hi, tnk you both for your responses, and pardon for my late answer. I had to manage the event, otherwise, it just wont page at all, just refreshes the page and thats it. It doesnt works with administrator either, and about the whole code.. well thats it; i just bind the grid to a datatable, not on page load, but when i click on a tree node. That part works, but when i tr to go to the next page, either doesnt do nothing (but refreshing the page) or just refreshes the page and makes the grid dissapear (as it has 0 rows)

Tnks again to both of you for your time.

 

hope that you can help me figure this one out.

 
New Post 12/11/2007 8:20 PM
User is offline dmayer
2 posts
10th Ranked


Re: Trouble paging Gridview 

Try this in the page_load:

gridview1.datasource = ??????

If Not ISPostBack Then

gridview1.databind()

End If

 
New Post 12/22/2007 4:10 PM
User is offline Daniel Tran
4 posts
10th Ranked


Re: Trouble paging Gridview 

I'm not sure my reply would help. Give it a try though. I guess you didn't associate the GridView.DataSource with a SqlDaSource or ObjectDataSource. That's why you need to handle the PageIndexChanging manually.

First, when you grab the data, attach it to the GridView. Then you save it to the this.Session, otherwise your datasource will be gone when the PageIndexChanging event gets fired. For example

    GridView1.DataSource = new ModuleNameController().GetData(); // assuming GetData() returns a DataTable
    this.Session["DataSource"] = GridView1.DataSource;

Then, you handle the PageIndexChanging

    protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            GridView1.DataSource = (DataTable)this.Session["DataSource"];
            GridView1.PageIndex = e.NewPageIndex;
            GridView1.DataBind();
        }

Happy programming

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Trouble paging Gridview
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


DNNCovered.com - Your Offshore Dotnetnuke Partner
Dnncovered.com is the only Dotnetnuke offshore outsourcing center specializes in DNN skinning and module development with lowest pricing and quality service. Our staff is dedicated to websites based on DNN and our graphic designers are creative and imaginative well enough to provide customers the complete set of skinning solutions and packages
www.dnncovered.com
PointClick.Net DNN Solutions
DotNetNuke Hosting Platform for Business and personal use.
PointClick.Net Hosted Solutions
Advanced Web Portals by Infoscaler
Infoscaler is a California based company that provides advanced Web Portals, E-commerce Sites, Database Applications and Intranet Solutions on the DotNetNuke and Microsoft.NET platforms.
www.infoscaler.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP