Solved

How to adjust column width at runtime

Posted on 2004-09-01
9
476 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
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 

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

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…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

707 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