Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7004143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:09:40+00:00 2026-05-27T21:09:40+00:00

I have a gridview and listview in my aspx pages which both display tables

  • 0

I have a gridview and listview in my aspx pages which both display tables from my database, the first column field displayed is the ID field. I would like the ID in descending order by default when the aspx pages load up, so that the data displayed is from newest to oldest(I’m making a review website). I’m not sure how to do this, when the page loads up, it displays data in ascending order instead. Users are able to click the ID column and change the order, but that’s not what I want.

Any help on how to do this would be much appreciated!

 <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
        AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="ID" 
        DataSourceID="DataSource">
        <Columns>
            <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" 
                ReadOnly="True" SortExpression="ID" />
            <asp:BoundField DataField="Name" HeaderText="Name" 
                SortExpression="Name" />
            <asp:BoundField DataField="Date" HeaderText="Date" 
                SortExpression="Date" />
            <asp:BoundField DataField="CPUModel" HeaderText="CPUModel" 
                SortExpression="CPUModel" />
            <asp:BoundField DataField="Manufacturer" HeaderText="Manufacturer" 
                SortExpression="Manufacturer" />
            <asp:ImageField DataImageUrlField="Picture">
            </asp:ImageField>  
        </Columns>
    </asp:GridView>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T21:09:40+00:00Added an answer on May 27, 2026 at 9:09 pm

    Can’t you just order by ID through your SQL datasource queries?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ListView which is using a GridView to display a DataTable and
I have a ListView with a GridView with 3 columns. I want last column
i want to display some information in a listview using the GridView. i have
I have a listview and I need to have width of first column automatic
Microsoft I think this may be a bug. Have a ListView GridView to display
I have a binding for ListViewItem, which is under gridview/listview/scrollviewer. <Setter Property=IsSelected Value={Binding IsSelected}/>
I have a GridView in a ListView contained in a ScrollViewer element. I understand
Background: I have a ListView / GridView with several columns. In some situations, only
I have a ListView with a GridView that's bound to the properties of a
I have GridView which I can select a row. I then have a button

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.