>Hi Paul!
>
>You're using a dummy cursor to allow the user to add/change, etc. That's what I was thinking of doing.
>
>How are you overcoming the inconsistency of the firing of the grid events, like determining whether a record has changed or not? Or, do you even care, since you're replacing the bizobj with the dummy information anyway?
In my case, the order table basically consists of a date field, a foreign key to a customer product, and a quantity (plus a few other misc. fields). I've got a view that looks exactly like what I want the UI to look like, except it's populated with all of the customer's products (I leave the order quantity empty). This view is table buffered. I query it, and a view that retrieves the customer's orders for the week. Then I scan through the dummy view/cursor and look up the orders for each product so I can populate the order quantity for a day of the week.
When the user attempts to save this information, I requery the order's for the week, then scan through my dummy cursor and look for matching products. If I find one, I update the quantity. If not, I add a new record. Once I'm finish, I call the business objects Save() method. Since the dummy cursor's is table buffered, you can do things like CURSORGETPROP(-1, "v_viewname") to see if things have changed.
Thankfully, I can do all of that kind of stuff when they save; I'm not trying to fire a bunch of events everytime they change something.
>
>Also, I have validation issues with some combobox columns, like if the user picks an item in combobox column 1, then I need to run some code to populate combobox column 4, etc. I'm assuming straight validation code will solve this one?
>
Yep. In the case of grids, I usually run into problems with other fields not being refreshed, so you're almost always better off delegating this kind of refresh to a form method (that is called from your combos). Then you can do things like SetFocus(), etc. to get things to refresh.
>Another thing that interests me is the ability to "magnify" a cell when it gets the focus, so it's obvious to the user where they are. If not that, then perhaps a background color change, maybe on a Getfocus() event?
>
I worked on an app. where one of the other developers had code in the When() event (I think, or GotFocus()) that automatically resized a textbox if the field values didn't fit. It was pretty simple code - it just set the width of the column I think. The one problem with trying to change the background color is that I'd bet that it won't always do what you want depending on how the Sparse property is set. I would probably (if this is VFP 8), set the highlight style to "2" and pick a better color. In most of the text field the background will be white when they've got focus (which makes it easy to see).
>I'm fishing for details, as you tell Paul. Trying to determine a "standard" as there are numerous grids in my POS app that need data entry capability.
>
>Thanks for the info!
I don't have any "secrets" regarding grids. They just take a ton of work when you try to do too much validation, color changing, etc (bells and whistles), so I try to keep that stuff to a minimum.