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

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 !!!
 
G

Guest

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 !!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top