JerryVT
|
Posted: 02/28/2004, 7:41 PM |
|
Hi,
In my Editable Grid I have several fields with Default values set in CCS.
If I'm doing an update of existing record(s) I'm getting new records inserted with these default values and empty Last/First name.
I want new records to be inserted only if LastName TextBox is not empty or doesn't contain just empty space(s).
Whare and how do I do this in CCS?
Thank you
|
|
|
DonB
|
Posted: 02/28/2004, 8:30 PM |
|
Ed Grid will always insert the "blank" rows if you put in default values for
any field, because they are no longer blank. Your options are to insert
via a separate record form or possibly put a custom update in the properties
panel. This is tricky because you have to squeeze an Iif() function into
the expression field (something that evaluates the field and, if blank,
inserts the desired default value). Unfortunately, the "Validate" event
does not fire on a per-row basis, otherwise you could write a nice
validation event to process each default. You might be able to make this
work in the existing Validate code by checking individual fields - haven't
tried that myself. I don't know if you can discern each row's field values
or not.
I assume you don't have a default on the database field because that is not
supported by your database?
The Ed Grid updates all displayed rows, not just the one you type into, by
the way. I think they are working on making this control better for a
future release.
--
DonB
http://www.gotodon.com/ccbth
"JerryVT" <JerryVT@forum.codecharge> wrote in message
news:640415f5e20298@news.codecharge.com...
> Hi,
> In my Editable Grid I have several fields with Default values set in CCS.
>
> If I'm doing an update of existing record(s) I'm getting new records
inserted with these default values and empty Last/First name.
>
> I want new records to be inserted only if LastName TextBox is not empty
or doesn't contain just empty space(s).
>
> Whare and how do I do this in CCS?
>
> Thank you
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
JerryVT
|
Posted: 02/28/2004, 10:55 PM |
|
Thank you again, Don
Before I'v read your answer I managed to cancel INSERT by
putting the following into BeforeSubmit event of my form:
If form.LastName.Value = "" OR form.LastName.Value = " " Then form.InsertAllowed = False
Now I have another problem - sorter of one of the columns gives an error: "()" when clicked.
I deleted it and inserted a new - same error - ()
|
|
|
|