At 08:25 AM 02/10/07, Alan Colburn wrote:

As users, however, we're accustomed to simply typing in a grid a la
spreadsheets. So how is the program set up to recognize when you're changing
attributes of an existing object, and when you want to create a new object?
I know that some people use StringGrids as read only displays and simply
have them display the attributes of each object in a collection anytime
there's a change inside the collection. ... But I'm talking about an
editable grid.

I hope this makes sense! Thanks, as always -- Al

Hi Al,

Like Robert and yourself I have often struggled here too, and like Robert especially with databases. When I first started using databases I thought that the events they fired were wonderful and that they would handle a lot of the peripheral things for me.

I then started to find that they were doing things when I didn't want them to do things, and interfering with what the program itself was trying to do.

This is probably not the best programming method for doing things, but almost every datamodule I now create has a flag called EDITMODE where I maintain this as either "user" or "program". When the program wants to do things like edit fields, insert records and the like, I set this flag and then a lot of the extra stuff I have to add to protect against the user doesn't need to be processed. This has worked very well for me since I started doing things this way.

Cheers,
Chris.

_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to