Solved

Best technique for persisting program options

Posted on 2007-04-05
2
207 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 500 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

696 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