<< little more background- I have a dynamic DataTable (could be 1 to
over 3000 columns), so I must have AutoGenerateColumns=true (I can't
set it to false, and create a boundfield for an unknown dynamic sized
table) >>
you're kidding, right? up to 3000 columns? .... this is software ... to be
used by humans ... not alchemy
leaving that aside (which you should not) it doesn't seem advisable to alter
column width every time a row is created; have you considered all the work
for the processor you're creating here .... I hate to ask how many rows
there may be in the control ...
"Yin99" <ws@ziowave.comwrote in message
news:7c399386-bd6d-4563-87db-f1d09241031f@b40g2000prf.googlegroups.com...
Quote:
>I have a Gridview binding to a DataTable source. I'd like to set the
column with of the second column. I cannot do this apparently because
when AutoGenerateColumns=true, they do not appear in the columns
collection.
>
I modified the RowCreated even to gridview, and I can change
properties on the cells, but not width. (setting tooltip, background
color, etc, all work but changing width has no effect). Here's
sample code I am using:
>
//Inside RowCreated Gridview Even
if (e.Row.RowType == DataControlRowType.DataRow)
{
foreach (TableCell tCell in e.Row.Cells)
{
tCell.ControlStyle.Width = 600; //no effect
tCell.Width = 600; //no effect
}
}
>
So the main question is, "Any way possible to change Gridview Column
Width with a DataTable source and AutoGenerateColumns=true?" Please
Help, I am at a loss here and been working on this for days....
>
-Yin
>
PS
little more background- I have a dynamic DataTable (could be 1 to
over 3000 columns), so I must have AutoGenerateColumns=true (I can't
set it to false, and create a boundfield for an unknown dynamic sized
table).