Solved

How to adjust column width at runtime

Posted on 2004-09-01
9
471 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
[X]
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
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

737 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