szenczi
Posts: 67
|
| Posted: 03/26/2008, 7:05 AM |
|
Hi,
How can I solve it?
I've got an editable grid with an empty row. I'd like to fill automatically the ID field of this empty row. It depends on the result of the editable grid's original query. This ID = biggest earlier value + any value.
Thanks,
Norbert
_________________
CCS5.1, PhP, MySQL |
 |
 |
szenczi
Posts: 67
|
| Posted: 03/27/2008, 6:18 AM |
|
I solved the first part of the function (search the biggest and calculate the new value).
But my main problem is how can I refer to the empty row and change the value of this row before inserting?
Thanks,
Norbert
_________________
CCS5.1, PhP, MySQL |
 |
 |
wkempees
Posts: 1679
|
| Posted: 03/27/2008, 6:49 AM |
|
You have editable grid with one blank row for new edits.
You have calculated your new ID value by adding 1 to the last known highest value.
Where do you store this value, in a session variable or a textlabel or a hidden field ?
Use the Custom Insert, it allows you to assign values to the Insert coning from various places, session, form, application etc.
Hope this helps.
Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
 |
 |
wkempees
Posts: 1679
|
| Posted: 03/27/2008, 6:50 AM |
|
PS: Why is your ID field not an autoincrement primary key?
That would automaticaly do what you describe.
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
 |
 |
szenczi
Posts: 67
|
| Posted: 03/27/2008, 7:12 AM |
|
It isn't a simple autoincrement primary key, because it depends on certain date(s). I can calculate the correct value programatically but I'd like to show this value in a text field in the empty row before the user fill in the other fields. (It is important to see by the user.)
Can I do this?
_________________
CCS5.1, PhP, MySQL |
 |
 |
wkempees
Posts: 1679
|
| Posted: 03/27/2008, 7:45 AM |
|
Yes, you can do this, in various ways.
You statet earlier you have calculated the correct new value, where do you store that?
You could do the calculation BeforeShow(Row), or store it in a sessionvariable, a textlabel.
Then follow the CustomInsert advice.
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
 |
 |
szenczi
Posts: 67
|
| Posted: 03/27/2008, 8:24 AM |
|
The calculation is in the BeforeShow event. The value is in a variable and I would like to show before any submit operation.
_________________
CCS5.1, PhP, MySQL |
 |
 |
|