Page 1 of 1

Grid messages

Posted: Sun Nov 06, 2011 2:52 am
by johnkane
How do you validate data entered in a cell of a grid?

Re: Grid messages

Posted: Mon Nov 07, 2011 5:11 am
by dunbarx
Hi.

When you say "validate", do you mean to check beforehand whether the data to be entered is a number, say, or perhaps a date, so that later functionality can expect to see the data in a format that will not generate an error?

How is your data entered? is it via an editable field in a datagrid or table field? Or is it via an "ask" dialog or somesuch?

The methods to check are different. In the first instance, you must check the data via messages that are sent either during typing or after closing a field or cell. In the second, you can validate under script control before the data is actually loaded.

Write back with details. You will get answers almost instantly.

Craig Newman

Re: Grid messages

Posted: Mon Nov 07, 2011 7:30 pm
by johnkane
If I can get a message that a cell is being closed and replace its contents with validated data, that would be ideal. I don't see any message -- like a closefield -- for a cell (close cell?)

I am fairly new to livecode, but have a lot of experience in the past with HyperCard/SuperCard/Toolbook

Re: Grid messages

Posted: Mon Nov 07, 2011 8:58 pm
by mwieder
John - welcome to the forum.

When you say "grid" are you talking about a datagrid control?

Update: and if so, you might want to check out the following lessons. The datagrid is a pretty specialized control and acts a bit differently from other controls (it's actually a group of groups with a behavior library).

http://lessons.runrev.com/s/lessons/m/d ... r-Editing-
http://lessons.runrev.com/s/lessons/m/d ... -Behavior-
http://lessons.runrev.com/s/lessons/m/d ... a-Grid-API