CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Grid edit is not allowing empty date or number

General discussion

by cjm » 27 May 2014 23:43

I am using Intraweb 14.0.31 and CGDevTools 2.1.0.3641. The grid editor does not seem to be allowing me to leave a date empty. If left empty it gives me a message about entering a valid date value. I have the same problem with numeric fields. When I submit they give an error message of "error Status: '500: '' is not a valid floating point value'. Error code: 500". Is there a way to make this work?
cjm
 
Posts: 8
Joined: 20 Mar 2013 19:26

by Jorge Sousa » 27 May 2014 23:54

Hi

If you don't want to use server regional settings, you must set


- For Dates:

Col.Formatter = gfcDate
Col.FormatOptionsDate.NewFormatDelphi

- For Floats:

Col.Formatter= gcfNumber

Col.FormatOptionsNumber.DecimalSeparator
Col.FormatOptionsNumber.ThousandsSeparator

- For Currency:

Col.Formatter= gcfCurrency

Col.FormatOptionsCurrency.DecimalSeparator
Col.FormatOptionsCurrency.ThousandsSeparator
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by cjm » 28 May 2014 20:20

I am setting the date column as follows:
GridCol.Editable := True;
GridCol.Formatter := gcfDate;
GridCol.EditOptions.DatePickerOptions.Disabled:= False;
GridCol.FormatOptionsDate.NewFormatDelphi := 'mm/dd/yyyy';
Getting the following error when the date is left empty:
error Status: '500: '''' is not a valid date and time'. Error code: 500

I am setting the numeric column as follows:
GridCol.Editable := True;
GridCol.Formatter := gcfNumber;
Getting the following error when it is left empty:
error Status: '500: '' is not a valid floating point value'. Error code: 500

The editing seems to work and save values as long as values are entered and they are not left empty. The users need to be able to leave the date fields empty when they do not have a date to enter. It should save a Null value when a date is not entered. I will write my own form for editing if I can not get this work but would appreciate any help you can give.

Thank You
cjm
 
Posts: 8
Joined: 20 Mar 2013 19:26

by Jorge Sousa » 29 May 2014 00:40

Hi

You can set Col.EditOptions.NullIfEmpty = True for inserts

or assign the event Provider.OnSetField to define you want you want to do.

Maybe you have to put the dataset in edit mode before clearing the field
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by cjm » 31 May 2014 00:30

I have used the Provider.OnSetValue event to set the date and number fields to null when the string is empty.
Thank you for the help.
cjm
 
Posts: 8
Joined: 20 Mar 2013 19:26


Return to General - Archive

Who is online

Users browsing this forum: No registered users and 2 guests

Contact Us.