invisible datagrid column

egdotnet

Regular
Joined
May 16, 2004
Messages
50
I have a datagrid, which is bound to a datatable with 4 or 5 columns, which in turn gets its data through a function from an xml document. now i need to have an ID column for things the datagrid the does, but don't want it to be visible. i tried using:

mydatagrid.columns(1).visible = false

but since the columns are bound at runtime, they appear when the page runs, but if i have it count the columns, the only one it knows is the one created at design time with the "select" button in each row. so is there a way to keep a bound column there, but make it invisible to the user?
 
egdotnet said:
I have a datagrid, which is bound to a datatable with 4 or 5 columns, which in turn gets its data through a function from an xml document. now i need to have an ID column for things the datagrid the does, but don't want it to be visible. i tried using:

mydatagrid.columns(1).visible = false

but since the columns are bound at runtime, they appear when the page runs, but if i have it count the columns, the only one it knows is the one created at design time with the "select" button in each row. so is there a way to keep a bound column there, but make it invisible to the user?
So this is a row ID?
or a common ID, where it is the same ID for every row in the column?
 
This is a row ID (remember that the it needs to remain consistent with the row it represents even when i sort, change pages), but unless there's a special way of assigning IDs (is there?), i'm not sure why that should matter.
 
invisible bound column

anybody know how to make a column bound at runtime invisible because the above suggestion didn't work?
 
but it doesn't! ive tried it tons of times & it can see the column created @ design time (w/ the select button) but if i have it tell me the number of columns in the grid, it only sees 1. it shows the other ones but i can't make them invisible.
 
the only thing is maybe i'm putting it in the wrong place... here's where i've been putting it:

datagrid1.datasource = showdata()
datagrid1.databind
datagrid1.columns(1).visible = false (i get an error here)
 
i think ur problem's in The Method showData()
coz i tried the code in many ways and it's work ur problem in this method check the code there
 
Back
Top