By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,516 Members | 1,176 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,516 IT Pros & Developers. It's quick & easy.

Datagrid Column Auto Sizing

P: n/a
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!!
Nov 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
* "Brian Mitchell" <Ma********@hotmail.com> scripsit:
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?

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2

P: n/a
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!!

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:2h************@uni-berlin.de...
* "Brian Mitchell" <Ma********@hotmail.com> scripsit:
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?

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #3

P: n/a
"Brian Mitchell" <Ma********@hotmail.com> wrote in
news:OI**************@TK2MSFTNGP10.phx.gbl:
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/
Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.