101 and counting
in your itemdatabound event do this:
e.item.cells[9].visible = false;
this will hide autogenerated columns. bound columns are part of the column
collection so if you have 2 bound columns your index will be 0 and 1 and you
would hide them the same way you were trying to hide them before. it can't
work for autogenerated columns because they aren't part of the columns
collection. ex if you have 2 bound columns and 4 autogenerated columns, you
only have index 0 and 1 which is why you kept getting and index out of range
when you tried to hide column 4. if you use the itemdatabound then you can
hide the 4 autogenerated columns but not the 2 bound columns for the same
reason
hope this helps
"Craig Burkett" <> wrote in message
news:...
> And you couldn't post it a 101st time? 
>
> Seriousely, what is the solution because I am having a similar problem.
The
> only difference is that I have a databound grid with two fixed columns and
> am wanting the rest of them to be auto generated. The problem is that the
> two fixed columns get duplicated in the grid because I can't keep them
from
> being auto-generated.
>
> Thanks,
> Craig
>
> "Alvin Bruney" <vapordan_spam_me_not@hotmail_no_spamhotmail.com > wrote in
> message news:...
> > i've posted a solution to the hundred other places you posted this
> question
> > "BK Kim" <> wrote in message
> > news:...
> > > Hello.
> > >
> > > I just populated my datagrid but I need to hide one of the column.
> > >
> > > Since I need this column's data, I cannot drop that column from my
store
> > > procedure.
> > >
> > > Is there a way I can make it invisible?
> > >
> > > I tried
> > >
> > > dataGrid1.Columns[1].visible = false;
> > >
> > > but didn't work and complained that I am out of index range.
> > >
> > > Any one know how to solve it?
> > >
> > > Thanx in advance
> > >
> > >
> >
> >
>