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 7804285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:51:54+00:00 2026-06-02T01:51:54+00:00

There’s a gridview on my asp page and sqldatasource to bind the data table

  • 0
  • There’s a gridview on my asp page and sqldatasource to bind the data
    table info to gridview.
  • I have 6 columns:
  • First column is called ID : type : int, increment by one , primary
    key.
  • The other columns are name,age etc..
  • The last column is called Added : type : datetime .

I need to add a button or dropdownlist doesn’t matter where I can sort the entire gridview rows by the DateTime Column.

  • 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-06-02T01:51:56+00:00Added an answer on June 2, 2026 at 1:51 am

    Since you’re using an SQLDataSource with the Gridview already, I would say using the AllowSorting property of the GridView (AllowSorting="True" in your markup) would be your easiest bet. This will auto-generate buttons that let you sort by any column you like.

    For example:

    <asp:GridView ID="GridView1" AllowSorting="True">
    

    A second option would be to do the sorting in your datasource. You could just change the SelectCommand in your SQLDataSource to end with “ORDER BY Added DESC.” This would be ideal if you do not want the sorting to be a dynamic, user-prompted event, but just a static, default sorting of the GridView that does not change.

    For example:

    <asp:SQLDataSource ID="SQLDataSource1"
        SelectCommand="SELECT ID, Name, Age, Column4, Column5, Added FROM yourTable ORDER BY Added DESC">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There have been several questions on SO regarding getting Contacts numbers using the Contacts
There's a combobox event in my code: self.combobox1.Bind(wx.EVT_COMBOBOX, self.onActionCombobox1) It executes the function def
There are a lot of questions about upgrading here, but I have another, very
There is a table view with three sections. The last section may contain many
There is a website called Gild.com that has different coding puzzles/challenges for users to
There is this strange situation I'm fighting on. I have 3 pages, les call
There in my mainwindow.xaml I've got the grid with: <CustomControl:GridControl ShowCustomGridLines=True Grid.Column=2 Grid.Row=0> <local:_13cap/>
There is a class that's a fully fledged UIViewController and when that page loads
There are two popular closure styles in javascript. The first I call anonymous constructor
There are numerous Agile software development methods. Which ones have you used in practice

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.