PC Review


Reply
Thread Tools Rate Thread

Datagrid Column Auto Sizing

 
 
Brian Mitchell
Guest
Posts: n/a
 
      19th May 2004
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!!


 
Reply With Quote
 
 
 
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      19th May 2004
* "Brian Mitchell" <(E-Mail Removed)> 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/>
 
Reply With Quote
 
Brian Mitchell
Guest
Posts: n/a
 
      19th May 2004
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]" <hirf-spam-me-(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> * "Brian Mitchell" <(E-Mail Removed)> 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/>



 
Reply With Quote
 
Chad Z. Hower aka Kudzu
Guest
Posts: n/a
 
      19th May 2004
"Brian Mitchell" <(E-Mail Removed)> wrote in
news:OIHwQ$(E-Mail Removed):
> 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/
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto Sizing Datagrid to Fit XML Table anthony.gilliam@gmail.com Microsoft C# .NET 0 20th Aug 2007 08:33 PM
Getting rid of the first (auto) column in DataGrid Vlad Microsoft Dot NET Framework Forms 2 7th Aug 2005 04:00 PM
Datagrid column sizing =?Utf-8?B?REM=?= Microsoft VB .NET 2 21st Mar 2005 05:33 PM
Column Auto Sizing =?Utf-8?B?b3JhbnNrZWVy?= Microsoft Excel Misc 2 4th Jan 2005 11:54 PM
Datagrid column auto adjustment Bill Nguyen Microsoft VB .NET 2 3rd Sep 2003 01:06 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:57 AM.