Home All Groups Group Topic Archive Search About

Resize Gridview width (not column width) based on size of data brought back.

Author
9 Jun 2009 5:06 AM
Hartman_Ralph
Does anyone know of a way to resize a gridview based on the size of
the data being placed inside the gridview.  For example my gridview is
populated dynamically from any number of different tables.  Some with
only a few columns and some with many columns with large amounts of
data.  I want to have the gridview property Gridview1.Width =
Unit.Pixel(400) when small and something like Gridview1.Unit.Pixel
(900) when many columns are brought back.

Thanks in advance for the help.

Hartman_Ra***@Hotmail.com

Author
13 Jun 2009 10:21 AM
Stan
On 9 June, 06:06, Hartman_Ra***@Hotmail.com wrote:
> Does anyone know of a way to resize a gridview based on the size of
> the data being placed inside the gridview.  For example my gridview is
> populated dynamically from any number of different tables.  Some with
> only a few columns and some with many columns with large amounts of
> data.  I want to have the gridview property Gridview1.Width =
> Unit.Pixel(400) when small and something like Gridview1.Unit.Pixel
> (900) when many columns are brought back.
>
> Thanks in advance for the help.
>
> Hartman_Ra***@Hotmail.com

Use the GridVIew1.Columns.Count property during the
GridView1.DataBound event to decide what value to set GridView1.Width