Datagrid Column Auto Sizing

  • Thread starter Thread starter Brian Mitchell
  • Start date Start date
B

Brian Mitchell

I hate to ask this question because I'm sure it's been asked before, but how
do you automatically resize the columns in a datagrid when the form is
resized?

Thanks!!
 
* "Brian Mitchell said:
I hate to ask this question because I'm sure it's been asked before, but how
do you automatically resize the columns in a datagrid when the form is
resized?

How would you like the columns to be resized?
 
Currently there are 5 columns and the sum of the column widths equals the
width of the data grid (that is how I want to keep it so the columns use up
all the available data grid space). Optimally, when someone resizes the form
I would like all the columns to resize but one column to resize a bit more
than the others. However, I will settle for the columns to resize together
at the same rate.

The current problem is that when I resize the form (the data grid is
anchored) the column widths don't change and that creates a lot of wasted
space on the data grid - plus it relies on the user to manually resize the
columns.

Thanks!!
 
Brian Mitchell said:
Currently there are 5 columns and the sum of the column widths equals
the width of the data grid (that is how I want to keep it so the columns
use up all the available data grid space). Optimally, when someone

In the resize event of the form just code your own code to resize the columns
as you wish.


--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Develop ASP.NET applications easier and in less time:
http://www.atozed.com/IntraWeb/
 
Back
Top