469,140 Members | 1,157 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,140 developers. It's quick & easy.

Control Datagrid height in vs2003

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
Apr 12 '07 #1
7 3077
On Apr 11, 9:45 pm, "Localbar" <localbar...@gmail.comwrote:
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
Check out Datagrid Girl's website, she always has something good to
say...

http://weblogs.asp.net/datagridgirl/.../11/71475.aspx
Apr 12 '07 #2
thx first....actually my program is vb.net....not asp.net
um...difficult to do

"Charlie Brown" <cb****@duclaw.com???
news:11**********************@n76g2000hsh.googlegr oups.com ???...
On Apr 11, 9:45 pm, "Localbar" <localbar...@gmail.comwrote:
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

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

http://weblogs.asp.net/datagridgirl/.../11/71475.aspx


Apr 12 '07 #3
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.

Apr 12 '07 #4
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)

"Charlie Brown" <cb****@duclaw.com???
news:11**********************@y80g2000hsf.googlegr oups.com ???...
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 panelI didn't
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.

Apr 12 '07 #5
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/Window...4c.aspx#q1075q

==========================
Clay Burch
Syncfusion, Inc.

Apr 12 '07 #6
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.

Apr 12 '07 #7
Clay
Thanks so much....
"ClayB" <cl***@syncfusion.com???
news:11**********************@p77g2000hsh.googlegr oups.com ???...
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.

Apr 13 '07 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Carlo Marchesoni | last post: by
2 posts views Thread by tshad | last post: by
3 posts views Thread by Tor Inge Rislaa | last post: by
1 post views Thread by Paul | last post: by
1 post views Thread by CARIGAR | last post: by
1 post views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.