Groups | Blog | Home
all groups > asp.net datagrid control > june 2006 >

asp.net datagrid control : Pass value of hidden fields in Gridview to SQL parameter


Hennie
6/20/2006 3:18:42 PM
How can I pass the value of a hidden field to the Parameter?

Thanks

Eliyahu Goldin
6/20/2006 5:40:59 PM
What exactly is the problem?

Eliyahu

[quoted text, click to view]

Hennie
6/20/2006 10:03:21 PM
I have a field (column) in a gridview with visible set as false.
I need the value of the field to be passed to a parameter in a stored
procedure to update the database.

When a field is hidden (visible=false) the value of the field is no longer
accesable. Is there a work around?


[quoted text, click to view]

Eliyahu Goldin
6/21/2006 12:00:00 AM
Columns with Visible=false don't render to the client and, naturally, don't
come back to server with postbacks. A work around is to hide the column with
css rule display:none while keeping Visible=true.

Eliyahu

[quoted text, click to view]

PeterKellner
6/29/2006 12:18:33 PM
On Tue, 20 Jun 2006 22:03:21 +0200, "Hennie" <spam_me@linux.com>
[quoted text, click to view]

You could also set the gridview attribute
datakeynames=[id,myhiddenfieldid]

and that will let you store in viewstate the value.
Peter Kellner
AddThis Social Bookmark Button