Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Display the last page initially in DataGrid, how?
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Display the last page initially in DataGrid, how?
Versions des environnements
Environment:
C# 1.1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01009344
Message ID:
01009344
Vues:
51
I've a pageable DataGrid bound to a DefaultView of a Table in a DataSet. Our client would like to see the last page first (which displays the most recent info), then go back to previous pages. For example, if there 5 pages, they will see "Page 5 of 5" first then they can click on the "Previous" link to see the other pages. How can I do that?

I've tried the following in the Page_Load event :
//Code Omitted
this.myDataGrid.DataSource = this.myDataSet.Tables[0].DefaultView;
this.myDataGrid.DataBind();
this.myDataGrid.CurrentPageIndex = this.myDataGrid.PageCount-1;
this.myDataGrid.DataSource = this.myDataSet.Tables[0].DefaultView;
this.myDataGrid.DataBind();
//Code Omitted
Which seems to display the last page but then Previous link doesn't work properly, it only pages back couple times and I never see the first page.
Dawa Tsering


"Do not let any unwholesome talk come out of your mouths,
but only what is helpful for building others up according to their needs,
that it may benefit those who listen."

- Ephesians 4:29-30 NIV

Dare to Question -- Care to Answer

Time is like water in a sponge, as long as you are willing you can always squeeze some.

--Lu Xun, Father of Modern Chinese Literature

Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform