Control Datagrid height in vs2003

L

Localbar

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
 
C

Charlie Brown

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/archive/2004/02/11/71475.aspx
 
C

Charlie Brown

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.
 
L

Localbar

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)
 
C

ClayB

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top