I needed to set the DataKeys property of my grid to the keyid of the underlying datasource. then I can get the value I want using
GridView1.SelectedDataKey.Value
>Hi
>
>I've got a grid on a webform. I'm using a Linqdatasource.
>
>The grid displays text items from the record but I want to trap the record id when a line is selected .
>
>I tried adding the record id to the grid as an invisible column but I don't get the record id then.
>
>Any suggestions on the best way to do this.
>
>
>Thanks
>
>
>Nick
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement