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

  • Home
  • SEARCH
  • 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 8605357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:48:39+00:00 2026-06-12T02:48:39+00:00

I have a DataGridView with all columns set to Automatic sort mode. When I

  • 0

I have a DataGridView with all columns set to Automatic sort mode. When I initially populate the grid, I use the OrderBy LINQ method to set the initial order, e.g. CustomerName, but when the user clicks the CustomerName column header, the grid redundantly sorts first ascending, and only then displays a glyph telling the user about the sort order.

I know I can programmatically sort by a column when I populate the grid, but everything I read indicates the columns’ sort modes should then be Programmatic. I want to keep the Automatic sort after the initial sort. How can I do this?

  • 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-12T02:48:41+00:00Added an answer on June 12, 2026 at 2:48 am

    For example, to sort by the first column, ascending, you initially do:

    dataGridView1.Sort(dataGridView1.Columns[0], ListSortDirection.Ascending);
    

    The sorting glyph will appear and you keep Automatic mode.

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

Sidebar

Related Questions

I have a datagridview in a WinForms application and I want all columns bar
I have a DataGridView that I would like all values on a specific row
I have DataGridView with two columns. The first column is TextBoxCol(DataGridViewTextBoxColumn) and the Second
I have DataGridView and I set DataSource of datagridview by using DataTables. DataTable dt
I have datagridview with checkbox column, but I want, that some of the columns
I have a DataGridView in a windows form. I defined 5 columns for this
I have created a datagridview with 3 columns as below : SR no tasks
I have a datagridview on a form with multiple columns. Three of the columns
I'm using a DataGridView and have AllowUserToAddRows set to True , so that once
I have a DataGridView bound to xml file. I would like to sort by

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.