473,385 Members | 1,553 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 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 2997
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: lauren quantrell | last post by:
A while back I got a requirement for the client to be able to adjust the relative heights of two subforms by click-dragging the mouse and I came up with a kludge solution using a border control...
3
by: jason | last post by:
I'll try to explain in detail what it is I'm struggling with. I created a SQL database with one table called CallSheet which contains the following columns: Caller ID: <--Primary Key, auto...
3
by: Steve | last post by:
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. ...
5
by: Steve Bugden | last post by:
Hi, I would like to set the column widths in the ASP.NET GridView control at runtime I have tried the following: http://msdn2.microsoft.com/en-us/library/ms178296.aspx Which uses the...
1
by: msch-prv | last post by:
I have difficulties adjusting the column width of a gridview control. The column width changes appear in the design grid, but at run-time the width changes back to what I presume are the grid's...
8
by: hussain123 | last post by:
Hi List, I am having two table one after the another.Even after setting the column width of both the tables the column takes the width of the data in that column. Ideally I want both the table's...
6
by: Christopher Glenn | last post by:
I have very basic html skills. My friend who has a wide screen monitor and is using IE7 sent me a jpg screen shot of my home page. I have attached this jpg, but I recall a while back that...
2
by: moondaddy | last post by:
Below is some xaml that is a mockup of a control I'm building. It's a shape that will be used in a diagramming tool. The red, blue and green rectangles simulate connectors on the side of the...
3
by: Gord | last post by:
If possible, how can the user be prevented from adjusting the column width and/or the row height in datasheet view (in VB code if necessary)? (I still want them to be able edit the contents of the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.