• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 517
  • Last Modified:

How to adjust column width at runtime

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
angireddy
Asked:
angireddy
  • 5
  • 4
1 Solution
 
bramsquadCommented:
this site should fully answer your question

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

~b
0
 
angireddyAuthor Commented:
But looks like, that algorithm will set all the columns to max, that could waste my other column area.
0
 
bramsquadCommented:
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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

 
angireddyAuthor Commented:
Can we do that at runtime, depending on the text length, the size of the column should change
0
 
angireddyAuthor Commented:
Please let me know how we can adjust the datagrid column width according to the text
0
 
bramsquadCommented:
i suggest you revisit the website.
0
 
angireddyAuthor Commented:
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
 
bramsquadCommented:
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
 
angireddyAuthor Commented:
Thank you, that's all I wanted to know, if its possible or not.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now