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="DatabaseFieldName or whatever"
value='<%# DataBinder.Eval(Container.DataItem, "DatabaseFieldName") %>'>
How to get the value at runtime?
HtmlInputHidden hinputDatabaseFieldName
=((HtmlInputHidden)e.Item.FindControl("DatabaseFie ldName"));
//e=DataGridCommandEventArgs
long aLongValue=Int64.Parse(hinputDatabaseFieldName.Val ue); //you might
check hinputDatabaseFieldName against null in case the column does not
exist.
Hope this help.
Prodip
"me" <wt*****@forum.dk> wrote in message
news:6f**************************@posting.google.c om...
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?