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 / Languages / VB.NET / April 2007

Tip: Looking for answers? Try searching our database.

Control Datagrid height in vs2003

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Localbar - 12 Apr 2007 02:45 GMT
hi all,

   my problem is...i have 2 textbox for user input no. of row and no.of
column. After user input, the datagrid will show what user input....for
example: user input 5 rows and 6 column. After that...the datagrid will
show.I would like to control the height for datagrid after generate... but i
only can control the width....any one have idea about this.

Thanks
Charlie Brown - 12 Apr 2007 04:02 GMT
> hi all,
>
[quoted text clipped - 5 lines]
>
> Thanks

Check out Datagrid Girl's website, she always has something good to
say...

http://weblogs.asp.net/datagridgirl/archive/2004/02/11/71475.aspx
Localbar - 12 Apr 2007 05:06 GMT
thx first....actually my program is vb.net....not asp.net
um...difficult to do

> > hi all,
> >
[quoted text clipped - 10 lines]
>
> http://weblogs.asp.net/datagridgirl/archive/2004/02/11/71475.aspx
Charlie Brown - 12 Apr 2007 06:29 GMT
My apologies, I was a little to quick to answer.

In both .net 1.1 and 2.0 for windows forms, the datagrid and
datagridview, respectively both support the Height property inherited
from the Control class.

If you can't get it work that way, your best bet is place a panel
control on your form, then place your datagrid inside there with the
datagrids dockstyle set to fill.  Then you can reesize the panel to
whatever you need, and the grid will follow suit.
Localbar - 12 Apr 2007 08:08 GMT
Thansks...
Actually ...I mean is row height....sorry I didn't write clearly
if user would like 5 row and 4 cloumn....after click generate button..
the grid will come out also each cell have same height and width ( for
example : may be each cell height = 100 width = 200)

> My apologies, I was a little to quick to answer.
>
[quoted text clipped - 6 lines]
> datagrids dockstyle set to fill.  Then you can reesize the panel to
> whatever you need, and the grid will follow suit.
ClayB - 12 Apr 2007 10:00 GMT
Programmatically setting rowheights in a Windows Forms DataGrid is not
simple as the proper methods and fields are not publicly exposed in
the DataGrid. Here is a FAQ entry that steps you through using
reflection to get at these necessary class members.

http://www.syncfusion.com/FAQ/WindowsForms/FAQ_c44c.aspx#q1075q

==========================
Clay Burch
Syncfusion, Inc.
ClayB - 12 Apr 2007 10:04 GMT
You can set all the rowheights to be the same fixed value by setting

          DataGrid1.PreferredRowHeight = xxxx

The previous comment regarding using reflection to set row heights is
only applicable if you need to make the rowheights vary from row to
row programmatically.
====================

Clay Burch
Syncfusion, Inc.
Localbar - 13 Apr 2007 04:56 GMT
Clay
Thanks so much....

> You can set all the rowheights to be the same fixed value by setting
>
[quoted text clipped - 7 lines]
> Clay Burch
> Syncfusion, Inc.

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.