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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:29:41+00:00 2026-05-18T20:29:41+00:00

I want to allow users to move column headers to the order that they

  • 0

I want to allow users to move column headers to the order that they want them and then save those settings so that they will be the same each time the user logs in to the application. I have a datagrid that does not have static headers. Its pulls its headers in from xml files. Since i do not have static headers, how would i save user settings in the data grid? Thanks

  • 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-18T20:29:42+00:00Added an answer on May 18, 2026 at 8:29 pm

    http://msdn.microsoft.com/en-us/library/aa730869%28v=vs.80%29.aspx

    There is a type of file, similar to but different that a config file, called the settings file. In it, you can define settings on an application-wide, or per-user basis. Think of it as if the AppSettings section of your config file got its own file, and you keyed the appSettings not only to name, but to user (or “Application”). I think this is what you’re looking for.

    Keep in mind that loading a lot of setting regarding the layout of a DataGridView will impact performance; you have to load the settings file from the file system, read all the keyed settings values, and adjust the column order.

    EDIT: Responding to the comment, yes it will work with dynamic column names, provided you design your use of the settings properly. How you would go about doing that depends on how the columns can vary. If it’s a localization thing, and columns sourced exactly the same way can have different names for translation or departmental jargon purposes, then define a constant internal name for that column source and use that in the settings. If users can choose a subset of a known collection of columns, then try defining a single setting that is a comma-separated list of column names, in the proper order. When retrieving it, match each column name in the list to the headers in the DGV, being intelligent about columns that don’t appear in one or the other. You could make the scenario of missing/extra column names unlikely by using the setting to set up the columns in the first place, and saving the names when you close the window or exit the app. That way, what the user sees on the first load of a new app is ordered the same as it was when they shut it down last time. Again, I would avoid using the actual column header text, and instead using some immutable ID for the column, because if the column header text ever has to change, the settings will become invalid, and best-case all the users will have to re-order their columns; worst-case, the app will break completely if you weren’t flexible about nonexistent column names.

    One caveat: Because settings files are local to the installation of the application, if the user uses multiple instances of the app (say one on a desktop and another on a laptop) and expects to see the same layout regardless of from where they log in, the settings file is not a good solution. You would be better served in this case by storing the user preferences in a central repository like a database, and retrieving it on login.

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

Sidebar

Related Questions

I want to allow users to move column headers to the order that they
I have a form that will allow users to move around the inputs (using
I have some labels that I want to allow users to edit. Is it
I want to allow users to create their resume online. Resume creation will have
I received a request from my users that they want is a common portal
I want to allow users to upload avatar-type images in a variety of formats
I want to allow users to paste <embed> and <object> HTML fragments (video players)
I want to allow users to upload files with transaction information to my application.
I want to allow users of my application to add sub-users and set privileges
I want to allow users to put in am img url instead of uploading

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.