473,395 Members | 1,368 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,395 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 2999
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.