CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 EditableGrid inserting condition

Print topic Send  topic

Author Message
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 - ()


Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.