?
Solved

Best technique for persisting program options

Posted on 2007-04-05
2
Medium Priority
?
210 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
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…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses
Course of the Month7 days, 19 hours left to enroll

765 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