How to hide column in autogenerated DataGRID ?!?!?!

  • Thread starter Thread starter jax
  • Start date Start date
J

jax

Hi All developers !

I have a datagrid which autogenerates columns by the
sql SELECT list... The list (for some reasons) must be the
same. So my question is

HOW TO MOVE OUT A COLUMN
FROM AUTOGENERATED DATAGRID?

I would really appreciated answer with some code ! :))

THANK YOU ALL !!!
 
One way is to make that column invisible at ItemDataBound of the datagrid, like this (vb syntax)

Private Sub grdTest_ItemDataBound(ByVal sender As Object,
ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs)
Handles grdTest.ItemDataBoun

e.Item.Cells(MyColumnIndex).Visible = Fals

End Su

If you were not autogenerating the columns, you could use .findcontrol to get the id, but I don't think you can set the id for autogenerated

hth

Bil

----- jax wrote: ----

Hi All developers

I have a datagrid which autogenerates columns by th
sql SELECT list... The list (for some reasons) must be th
same. So my question i

HOW TO MOVE OUT A COLUM
FROM AUTOGENERATED DATAGRID

I would really appreciated answer with some code ! :)

THANK YOU ALL !!
 
Back
Top