473,885 Members | 2,436 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3244
On Apr 11, 9:45 pm, "Localbar" <localbar...@gm ail.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....actual ly my program is vb.net....not asp.net
um...difficult to do

"Charlie Brown" <cb****@duclaw. com???
news:11******** **************@ n76g2000hsh.goo glegroups.com ???...
On Apr 11, 9:45 pm, "Localbar" <localbar...@gm ail.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.goo glegroups.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
Programmaticall y 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.Prefe rredRowHeight = 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 programmaticall y.
=============== =====

Clay Burch
Syncfusion, Inc.

Apr 12 '07 #7
Clay
Thanks so much....
"ClayB" <cl***@syncfusi on.com???
news:11******** **************@ p77g2000hsh.goo glegroups.com ???...
You can set all the rowheights to be the same fixed value by setting

DataGrid1.Prefe rredRowHeight = 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 programmaticall y.
=============== =====

Clay Burch
Syncfusion, Inc.

Apr 13 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
2344
by: Gilles T. | last post by:
How I can get element ID in the edit mode of datagrid control? If I not in the edit mode, there are no problem. <asp:TemplateColumn ItemStyle-CssClass="grid_column_width_3" ItemStyle-HorizontalAlign="center" ItemStyle-VerticalAlign="top"> <ItemTemplate><%# CType(Container.DataItem("DateStatut"),DateTime).ToString("yyyy-MM-dd") %></ItemTemplate> <EditItemTemplate> <asp:TextBox width="80" CssClass="edit_item" id="txtDateStatut"
2
1741
by: Carlo Marchesoni | last post by:
I have a very basic question using the DataGrid. What I want to achieve is controlling the size of it (specially the height of the rows). The DataGrid adjusts the row size according to the amount of rows bound - and if there are no rows at all, the DataGrid is visualized with a huge Header and nothing else. How can I avoid this ? Thanks a lot for your help
2
3239
by: tshad | last post by:
This is related to my other Hiding datalistitems problem that I can't seem to solve. I have tried different methods which all seem to work only partially. I decided to try to use a User Control (which I'm sure is not done correctly) and get errors as I try to execute it. What I want to do is take all the data from between the ItemTemplate tags and put a control there. The I hope to be able to hide all the user
3
1743
by: Tor Inge Rislaa | last post by:
Hi, I have a need of controlling the row height of the individual rows in a data grid. The row height will be adjusted after the datagrid is filed with data and the height will be different for each row. How do I loop trough the rows and set the row height. TIRislaa
0
2293
by: Keith | last post by:
I have a repeater control that contains a HeaderTemplate and an ItemTemplate. Each item contains a checkbox with an ID of chkReconciled, and the header contains a single checkbox with an ID of chkAll. I simply want to have chkAll be checked if every item in the repeater has its checkbox checked. In the code behind page, I can access the checked property of chkReconciled by doing the following: Dim CurrentCheckBox As CheckBox...
0
1077
by: billmiami2 | last post by:
I have a machine (XP PRO x64) with both the .NET 2.0 (v2.0.50727) and 1.1 (v1.1.4322) frameworks installed. I have both VS2005 and VS2003 running. I'm using Dennis Bauer's ASP.NET version switcher to set the desired framework for specific web applications. I'm also running all applications using 1.1 in a different application pool from those using 2.0. Everything seemed to be running fine until I opened an existing application in...
15
1857
by: Hamed | last post by:
Have I posted the message to wrong newsgroup? Or Does the question is so much strage? Would someone please kindly direct me to a true newsgroup or resource? Best Regards Hamed
1
1169
by: Paul | last post by:
is the gridview control in vs2005 the same as the datagrid in vs2003 or is there a datagrid control in 2005 called datagrid? thanks. -- Paul G Software engineer.
0
11170
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10426
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9591
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7985
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7137
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6009
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4623
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4231
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3243
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.