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; //
}
"Nick" <nc**********@gmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Sorry, I meant Gridview
"Nick" <nc**********@gmail.com> wrote in message
news:%2****************@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