I have a hidden (primary key) object in my GridView:
<asp:HiddenField ID="hidRemUUID" runat="server" Value='<%# Eval("MyUUID")
%>' />
Now, there is a more elegant way to keep track of the primary key... with a
GridView.
You might want to look into this also:
DataKeyNames="MyUUID" (this is declared in the <asp:GridView> element.
Then you can get to it like this:
protected void GridView1_SelectedIndexChanged(object sender, EventArgs
e)
{
GridView gv = (GridView)sender;
//string str0 = gv.DataKeyNames[0];
System.Guid uuid = (System.Guid)gv.DataKeys[gv.SelectedIndex].Value;
// or
//string uuid = (string)gv.DataKeys[gv.SelectedIndex].Value; //
}
[quoted text, click to view] "Nick" <ncik.rawlins@gmail.com> wrote in message
news:%23ecwGBlOGHA.2624@TK2MSFTNGP12.phx.gbl...
> Sorry, I meant Gridview
>
>
> "Nick" <ncik.rawlins@gmail.com> wrote in message
> news:%23nftH$kOGHA.2604@TK2MSFTNGP09.phx.gbl...
> > For some reason, why does ASP.net only see variables that are
'DISPLAYED'
> > inside a datagrid?
> >
> > Even if the Field is Databound, I cannot post the variable or use it in
an
> > updatecommand... it has to be visible??
> >
> >
> > I've tried putting the field on the page but making 'Visible = false'
but
> > it still dosen't want to post or anything.
> >
> >
> > Is it a bug in Visual Web Developer 2005?
> >
> >
> > Cheers
> >
>
>