Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Best technique for persisting program options

Posted on 2007-04-05
2
Medium Priority
?
213 Views
Last Modified: 2010-04-15
I'm using VS2005 C#.  I have a custom data grid that holds many date values.  If any date is within so many days from the current date, that cell is colored a specific color (such as yellow).  If any date on the grid is earlier than the system date that cell is colored a specific color (such as red).  The person using the program will determine their own color key,and their color key will be persisted with the data grid.  If the program is started for the first time, and there are no open files, there still has to be a default color key that comes with the program.  

My question is this:  what is the best way to persist the default color key.  Should it be in the registry or as a runtime class or some other method?
0
Comment
Question by:fly412s
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 10

Expert Comment

by:Si_Hibbard
ID: 18862805
I would probably use an xml file to store app settings. Maybe this will help - example of using xml and datasets.

http://www.codeproject.com/dotnet/XMLSettingsFile.asp
0
 
LVL 9

Accepted Solution

by:
ripahoratiu earned 1500 total points
ID: 18862870
The best way would be to have it coded into your application as follows:
1. I'm assuming that you've extended the datagrid and you have 2 properties Colour1 and Colour2
2. After putting the control in a form or whatever, set the two properties into Property Pane: in Data -> ApplicationSettings, PropertyBinding and search there for them. You can set the default value and the scope (per user or per application). Once you've set them check that the value of the properties are updated on any change in the XML repository (in designer DataBindings.Add(new System.Windows.Forms.Binding .... has the last parameter System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)
3. Save the Apllication setting once you leave the form, or anytime the user modifies the colour.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question