You can't hide the asp control. If you set the visible property of an asp
control, you would have nothing rendered on the client. Generic Html control
is the solution--
If are trying to hide a column in a grid, use something like this in the
grid's column template:
<input type="hidden" runat="server" id="DatabaseFie ldName or whatever"
value='<%# DataBinder.Eval (Container.Data Item, "DatabaseFieldN ame") %>'>
How to get the value at runtime?
HtmlInputHidden hinputDatabaseF ieldName
=((HtmlInputHid den)e.Item.Find Control("Databa seFieldName"));
//e=DataGridComma ndEventArgs
long aLongValue=Int6 4.Parse(hinputD atabaseFieldNam e.Value); //you might
check hinputDatabaseF ieldName against null in case the column does not
exist.
Hope this help.
Prodip
"me" <wt*****@forum. dk> wrote in message
news:6f******** *************** ***@posting.goo gle.com...
I have a column in my datagrid showing the
unique identifier of the rows from the database.
I want to hide it but if I switch "visible" off in
visual studios property builder for datagrids then
the column is removed completely. I still need to
access the ID programmably on Update events (its
an editable datagrid). How do I achieve that?