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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:04:12+00:00 2026-06-01T05:04:12+00:00

I have a windows form where I am using DataGridView control. It is bind

  • 0

I have a windows form where I am using DataGridView control. It is bind to a bindingsource at design time. Via code I am adding 3 more columns to the DataGridView control. I am first checking if these 3 columns are exists or not. If yes, I am removing those from the DataGridView and adding them back.

For the first iteration, the order of the column is proper say A, B, C. But for next iteration the order of these newly added columns changes as C, B, A.

I tried setting AutoGenerateColumns to false in the constructor. But it is not working for me.
Datasource is assigned at design time.

Please help me out to resolve this issue.

  • 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-01T05:04:13+00:00Added an answer on June 1, 2026 at 5:04 am

    Based on Steve’s comment, I found an alternative to this issue. Now I am checking the existence of column. If column is already added to the grid, I am not removing and adding it again. This prevents the original order in which those columns are added.

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

Sidebar

Related Questions

I have datagridviews on windows form, i am adding records to datagridview using small
I have a Windows form that's generated using code (including buttons and what not).
I have a windows form control inside wpf application using a windows forms host.
I have a c# windows form project using watin. I would love to attach
I'm using C# and I have windows form and web service... I have a
I'm coding a windows form using WPF, XAML, C#. I have a Frame object
I am using a windows form and within the form i have a user
Im using c# .net windows form application. i have a SQL database with 5
Im using c# .net windows form application. I have many databases created using sql
Im using c# .net windows form application. I have loaded names of all the

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.