Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / March 2008

Tip: Looking for answers? Try searching our database.

Increase length of datagrid as form length increases

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
max.sofia@gmail.com - 18 Mar 2008 14:26 GMT
I am about to do what I thought was a simple task. I have a datagrid
in a form. When I increase the height of my form when running the
application I want the datagrid to increase aswell. How do I do it? I
cannot seem to increase my datagrid at all when running the app.
Rob Oldfield - 19 Mar 2008 14:53 GMT
> I am about to do what I thought was a simple task. I have a datagrid
> in a form. When I increase the height of my form when running the
> application I want the datagrid to increase aswell. How do I do it? I
> cannot seem to increase my datagrid at all when running the app.

Play with either the dock or anchor properties of the datagrid.

Setting the anchor to something like both top and bottom will keep the same
distance between the top/bottom of the form as it resizes.  

My preferred solution though would be to use panels and dock settings.  Try
this:

Add a panel to a form and set it's dock property to bottom.  Add a splitter
to the form and also set it to dock bottom (that should mean that it lies
across the top of the first panel).  Add another panel in the top of the form
and set that to dock full (so it takes up the remaining space).  Add a
datagrid into the middle of the top panel and set that to dock full as well.  
See how that works for you.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.