lirving
Posts: 26
|
Posted: 11/01/2013, 7:20 AM |
|
I have an editable grid with two hidden fields Added_by and Date_added
I use the method from the help and set the default value in the properties box to ccgetuserID and currentdatetime respectively. It does not update the database.
If I change the field to visible and add the values manually it does update the database.
Is this expected behaviour for the editable grid and if it is what should I do to make it work.
The help is very confusing There is an animated gif but it stops just before they actually set the default value. This seems to be a shortcoming of the help it seems to be a little light on examples.
I found three different helparticles that say
Add a Hidden "Assigned By" Field to Auto-Update New Tasks
I tried CCGetSession("UserID") - that gives and internal server error
and Session.UserID - that gives and internal server error
and ccgetuserID - No server error but no update
They are all different and none seem to work for me
Finally I have a record called articles with a grid called attachements under it on the page.
I want to hide it if I am adding a new record.
so I want to say something like the code below
' -------------------------
If KBarticles.KBArticles_ID.value < "1" Then
attachments.Visible = false
End if
' -------------------------
'End Custom Code
Or like
if isnull kbarticles_ID then attachments.Visible = false
Any help appreciated
_________________
LW Irving
lirving@coffs.com.au |
|
|
anthonyzz
Posts: 19
|
Posted: 02/27/2014, 12:03 AM |
|
I am recently also dealing with some C# grid:
http://www.kettic.com/winforms_ui/gridview.shtml
And I found some information about the the textbox in grid:
http://www.kettic.com/winforms_ui/csharp_guide/gridview...ox_column.shtml
hope this can offer you some kind of hlep
_________________
no more |
|
|
eratech
Posts: 513
|
Posted: 02/27/2014, 6:59 PM |
|
LW Irving - I've had something similar with the Default values on records. I think sometimes I was in Update mode not Insert mode, and the Default value only works for Inserts. If you are editing (Update) then it doesn't overwrite the values in the hidden fields.
I got around it by always putting a couple of 'Retrieve Value for Control' actions in the 'Before Update' event for the record and that solved it. If you are always using the same field names across multiple forms, you can also make your own function, and do a onestep 'Call Function' for it.
From memory, the 'ccgetuserID' is the correct one, providing the user is correctly logged in.
I'll think about the other problem later.
Thanks
Eric
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia |
|
|
eratech
Posts: 513
|
Posted: 02/27/2014, 8:06 PM |
|
For the hiding (and this is from memory), you can put a 'Before Show' event 'Hide-Show component' on the Record with the "Component" being the Grid name, and compare the "IsEdit" mode (Special value) for the Record. If false (Insert mode) then hide (it will hide the Grid as that is the component referenced)
I'll find where I've used it before and put more detail in later, but that's the way I've done it.
You can run into problems with checking for ID < "1" because it's a string (is string "0" less than string "1"?) or if there is no value. And the 'null' check may not work in the ASP.
Eric
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia |
|
|
|