getting the value of a hidden column in datagrid

E

Ekempd

I have a hidden column in my datagrid but I can't read the value of this column

Usually I use e.Item.Cells(7).Controls(1) to get the control but with the
hidden column I get the control but without value...

The source problem begin in I habe a datatable with 15 column and I only
want to display 14, the other is the primary key, when I want to do an Insert
I have to know this field but I don't know how.. then I try to adding as a
hidden column to my grid without success..

Any Sugestion?

thx
 
J

John Saunders

Ekempd said:
I have a hidden column in my datagrid but I can't read the value of this
column

Usually I use e.Item.Cells(7).Controls(1) to get the control but with the
hidden column I get the control but without value...

The source problem begin in I habe a datatable with 15 column and I only
want to display 14, the other is the primary key, when I want to do an
Insert
I have to know this field but I don't know how.. then I try to adding as a
hidden column to my grid without success..

If you're trying to save the primary key, use the DataKey property of the
DataGrid. It will cause the key to be saved in the DataKeys array of the
DataGrid. Then you can index into that array by
DataKeys(gridItem.ItemIndex).

John Saunders
 
E

Ekempd

thanks
that help.!! but with multipart keys?? (composite keys)

I solve my problem adding some textbox hidden with the values for the case
of multipart keys..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,223
Latest member
Jurgen2087

Latest Threads

Top