471,357 Members | 1,274 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,357 software developers and data experts.

Adjust Column width at runtime??

Visual Studio 2003 / C#

Is it possible to change the width of the columns in a datagrid at runtime?
I am generating and populating a dataset at runtime, then binding a datagrid
to this dataset. The only problem is all the columns in it are about 75 in
width, and this looks lame in the view as there is over half of the datagrid
unused. I want to extend one of the columns, a description column, to fill
the datagrids width. Is this possible?

Thanks

Steve
Jul 26 '05 #1
3 2894
The UltraGridColumn class has a Width property. Just change that to whatever
you want.

"Steve" <St***@discussions.microsoft.com> wrote in message
news:9C**********************************@microsof t.com...
Visual Studio 2003 / C#

Is it possible to change the width of the columns in a datagrid at
runtime?
I am generating and populating a dataset at runtime, then binding a
datagrid
to this dataset. The only problem is all the columns in it are about 75
in
width, and this looks lame in the view as there is over half of the
datagrid
unused. I want to extend one of the columns, a description column, to
fill
the datagrids width. Is this possible?

Thanks

Steve

Jul 26 '05 #2

In the end I created a TabStyle with the columns I needed at the widths I
wanted, but with no mappings, then at runtime after I have created and
populated the dataset I just map the relevant fields to those in th
TableStyle. Which worked a treat.

Cheers anyway.
"Marina" wrote:
The UltraGridColumn class has a Width property. Just change that to whatever
you want.

"Steve" <St***@discussions.microsoft.com> wrote in message
news:9C**********************************@microsof t.com...
Visual Studio 2003 / C#

Is it possible to change the width of the columns in a datagrid at
runtime?
I am generating and populating a dataset at runtime, then binding a
datagrid
to this dataset. The only problem is all the columns in it are about 75
in
width, and this looks lame in the view as there is over half of the
datagrid
unused. I want to extend one of the columns, a description column, to
fill
the datagrids width. Is this possible?

Thanks

Steve


Jul 26 '05 #3
Sorry, I thought for some reason you were talking about the Infragistics
grid.

Are you using the web or windows grid? I am pretty sure in either case
there's got to be a Width property for the columns.

"Marina" <so*****@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
The UltraGridColumn class has a Width property. Just change that to
whatever you want.

"Steve" <St***@discussions.microsoft.com> wrote in message
news:9C**********************************@microsof t.com...
Visual Studio 2003 / C#

Is it possible to change the width of the columns in a datagrid at
runtime?
I am generating and populating a dataset at runtime, then binding a
datagrid
to this dataset. The only problem is all the columns in it are about 75
in
width, and this looks lame in the view as there is over half of the
datagrid
unused. I want to extend one of the columns, a description column, to
fill
the datagrids width. Is this possible?

Thanks

Steve


Jul 26 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by jason | last post: by
3 posts views Thread by Steve | last post: by
5 posts views Thread by Steve Bugden | last post: by
1 post views Thread by msch-prv | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.