Click here to Skip to main content
15,913,263 members
Home / Discussions / C#
   

C#

 
General#Speed Pin
Sumudu Perera6-Mar-02 6:37
Sumudu Perera6-Mar-02 6:37 
GeneralRe: #Speed Pin
6-Mar-02 7:24
suss6-Mar-02 7:24 
GeneralRe: #Speed Pin
Sumudu Perera10-Mar-02 6:00
Sumudu Perera10-Mar-02 6:00 
GeneralRe: #Speed Pin
James T. Johnson10-Mar-02 9:45
James T. Johnson10-Mar-02 9:45 
Generalwindows service in c# Pin
omkamal6-Mar-02 4:14
omkamal6-Mar-02 4:14 
GeneralRe: windows service in c# Pin
8-May-02 12:27
suss8-May-02 12:27 
GeneralDeclarative Code Access Security Pin
6-Mar-02 3:58
suss6-Mar-02 3:58 
General**** The DataGrids! All of them! Pin
Domenic Denicola6-Mar-02 3:21
Domenic Denicola6-Mar-02 3:21 
Mad | :mad: Mad | :mad: Mad | :mad:

I've spent a lot of time playing with my datagrid control and its associated datatable, and I think I did it all wrong. My scheme is way to complicated. I read a user defined data structure in from a file, then fill out the datagrid from it. Then I track any changes to the datagrid, update the datagrid to reflect these changes (these former two steps are giving me too much trouble, prolly b/c my overlycomplicated design), and then rebuild the structure from these changes. However, there seems to be some interdependencies in the updating of the datagrid that depends upon nonupdated information in the data structure, and it's all a big mess. Cry | :((

My actual on-disk data format is XML, which is then parsed into the datastructure for program specific manipulations (calculating chess scores from a tournament database if you must know). I want my users to be able to create and edit chess tournament databases using this datagrid, which will then be mapped into the in-memory data structure for the calculation and manipulation, and finally saved to a disk in XML format. I have all the XML -> Datastructure and Datastructure -> XML stuff down, but the user input is really getting to me.

So, before I start with my datagrid all over again, I need to know how I'm supposed to do this. My current idea is:

+ Load the file into the data structure
+ Update the datagrid/datatable (I am using them as one, there's only one table).
+ Use the RowChanged event to determine when the datagrid is modified. If so, make those changes INSIDE THE DATA STRUCTURE. Then, after the datastructure is updated, set a flag so that RowChanged does nothing, and rebuild the datagrid from the beginning using the data structure. After it is rebuilt, set the RowChanged flag back so that it responds to user input. I want RowChanged to respond to userinput, but not to respond to itself. I will know this all works when I can throw any valid input into it, and get the same thing out, only now stored in the data structure. When I throw in invalid or incomplete (ie, half a row) input, it should not parse it at all, simply leave it there.

Sound good? There must be a standard way of doing this. I am completely new to all this database stuff.

-Domenic Denicola- [CPUA 0x1337]
MadHamster Creations

"I was born human. But this was an accident of fate - a condition merely of time and place. I believe it's something we have the power to change..."

GeneralRe: **** The DataGrids! All of them! Pin
James T. Johnson6-Mar-02 13:05
James T. Johnson6-Mar-02 13:05 
GeneralRe: **** The DataGrids! All of them! Pin
Domenic Denicola6-Mar-02 13:39
Domenic Denicola6-Mar-02 13:39 
GeneralRe: **** The DataGrids! All of them! Pin
James T. Johnson6-Mar-02 14:52
James T. Johnson6-Mar-02 14:52 
GeneralRe: **** The DataGrids! All of them! Pin
Domenic Denicola6-Mar-02 15:08
Domenic Denicola6-Mar-02 15:08 
GeneralRe: **** The DataGrids! All of them! Pin
James T. Johnson6-Mar-02 15:36
James T. Johnson6-Mar-02 15:36 
GeneralErrors & Exceptions in C# Pin
Anand Amirineni5-Mar-02 13:05
Anand Amirineni5-Mar-02 13:05 
GeneralRe: Errors & Exceptions in C# Pin
James T. Johnson5-Mar-02 15:50
James T. Johnson5-Mar-02 15:50 
GeneralRe: Errors & Exceptions in C# Pin
7-Mar-02 18:17
suss7-Mar-02 18:17 
QuestionHow to store an object into a database? Pin
5-Mar-02 9:17
suss5-Mar-02 9:17 
AnswerRe: How to store an object into a database? Pin
James T. Johnson5-Mar-02 10:06
James T. Johnson5-Mar-02 10:06 
AnswerRe: How to store an object into a database? Pin
James T. Johnson6-Mar-02 10:20
James T. Johnson6-Mar-02 10:20 
GeneralRe: How to store an object into a database? Pin
AndyG6-Mar-02 18:26
AndyG6-Mar-02 18:26 
Generalhelp in treeview needed Pin
4-Mar-02 22:38
suss4-Mar-02 22:38 
GeneralRe: help in treeview needed Pin
Anand Amirineni5-Mar-02 14:12
Anand Amirineni5-Mar-02 14:12 
QuestionHow to use SSL Pin
Felix Nielsen4-Mar-02 9:19
Felix Nielsen4-Mar-02 9:19 
QuestionHow to sublass visually a C# class Pin
4-Mar-02 6:03
suss4-Mar-02 6:03 
AnswerRe: How to sublass visually a C# class Pin
James T. Johnson4-Mar-02 14:12
James T. Johnson4-Mar-02 14:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.