Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How to adjust column width at runtime

Posted on 2004-09-01
9
461 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Gridview selected row 9 49
Need help making a program or form for inventory that exports to txt 8 43
Regex validation 2 28
Visual Studios 1 76
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

839 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