Solved

How to adjust column width at runtime

Posted on 2004-09-01
9
458 Views
Last Modified: 2010-04-23
I want to know how to adjust column width at runtime, the column width should change depending on the max length of the coloumn data in all rows.
0
Comment
Question by:angireddy
  • 5
  • 4
9 Comments
 
LVL 8

Expert Comment

by:bramsquad
ID: 11955278
this site should fully answer your question

http://support.microsoft.com/default.aspx?scid=kb;en-us;812422&sd=tech#6

~b
0
 

Author Comment

by:angireddy
ID: 11955354
But looks like, that algorithm will set all the columns to max, that could waste my other column area.
0
 
LVL 8

Expert Comment

by:bramsquad
ID: 11955400
this makes the column field the maximum they ahve to be to still view the data....like if you were to double click between columns in access or excel.

and sorry heres a vb one

http://support.microsoft.com/default.aspx?scid=kb;en-us;811203

0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

Author Comment

by:angireddy
ID: 12008980
Can we do that at runtime, depending on the text length, the size of the column should change
0
 

Author Comment

by:angireddy
ID: 12048144
Please let me know how we can adjust the datagrid column width according to the text
0
 
LVL 8

Expert Comment

by:bramsquad
ID: 12051001
i suggest you revisit the website.
0
 

Author Comment

by:angireddy
ID: 12053948
In the website, ther are setting the longest column element to the datagrid, that means all the columns width will be adjusted to the longest column size. So, its waste of space and the grid view is going out of screen. Please let me know if we can adjust the column width depending on the data. Like the first column be "Thomas" and the next be "He works at IBM", in this example the datagrid column width for 2nd column will be more than the 1st. Please let me know if this is possible.

Reddy
0
 
LVL 8

Accepted Solution

by:
bramsquad earned 200 total points
ID: 12054145
the column width can only be one size.  

if you are asking whether or not each CELL has its own size depending on the data within it.....i highly doubt it, and ive never seen or heard of that done.  

>>"Like the first column be "Thomas" and the next be "He works at IBM", in this example the datagrid column width for 2nd >>column will be more than the 1st. Please let me know if this is possible."

im having trouble understanding this....do you mean column or row within a column?

either way, i dont think its possible to adjust the width of every cell in a  datagrid.....and even if you could, aestetically speaking, that would be pretty unorganized and messy looking way to represent data

~b

0
 

Author Comment

by:angireddy
ID: 12054181
Thank you, that's all I wanted to know, if its possible or not.
0

Featured Post

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to use odbc in vb to connect to ms sql 14 54
Ajax Panel Not Updating When Triggered By Timer 4 73
Gridview selected row 9 47
VB.NET 2008 Publish Error 2 27
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question