473,837 Members | 1,426 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Increase Datagridview size by dragging the form

Hi,

I have a datagridview and some Buttons on a form. When I drag the form down
to increase its size at run time, i want the datagridview also to increase
in size so that i can view all the data in the grid at a time, instead of
scrolling.
This is a common scenario but i am not able to figure out how to do this.

TIA
Irfan
Jan 12 '07 #1
2 2538
Hi,
You could change the size of the DataGridView in the forms OnSizeChanged
event

Mike Powell
www.ramuseco.com

"Irfan" <ir***@asc-ltd.co.ukwrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
Hi,

I have a datagridview and some Buttons on a form. When I drag the form
down to increase its size at run time, i want the datagridview also to
increase in size so that i can view all the data in the grid at a time,
instead of scrolling.
This is a common scenario but i am not able to figure out how to do this.

TIA
Irfan


Jan 12 '07 #2
I don't know where the buttons on your form are. If they are
at the top, Set the anchor properties of your DataGridView
to Left, Right, Bottom. If your buttons are elsewhere, just act
accordingly.

You can also add a panel to your form and put the DGV inside it
(dock inside parent). Then set the anchoring properties on the panel.

Robin S.
------------------------
"Irfan" <ir***@asc-ltd.co.ukwrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
Hi,

I have a datagridview and some Buttons on a form. When I drag the form
down to increase its size at run time, i want the datagridview also to
increase in size so that i can view all the data in the grid at a
time, instead of scrolling.
This is a common scenario but i am not able to figure out how to do
this.

TIA
Irfan


Jan 12 '07 #3

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

Similar topics

5
23303
by: VMI | last post by:
How can I increase the maximum size of a Windows form? I'm trying to make a really big Windows form (about 1000x1000) but the designer doesn't allow me to do that. It only goes up to 1000x780. Somebody suggested going to the form's Properties >> Layout >> Size 1000,1000 but my version -Studio '02 v1.0- doesn't have that property. Am I missing something? Thanks.
0
415
by: Mark Carew | last post by:
Hi, I'm writing a winform app (as practice) that has as one of its features a button that reads an xml file to a datagridview. No matter what I do I get two columns instead of one. The "first column", I retrieve and place the text "Holy Cat" in its header text. This column contains no data from the xml file. The second column contains the correct data from the xml file.
2
7456
by: Rich | last post by:
Hello, Some database applicatins have a tooltip feature where when you are dragging the scrollbar of the table view a tooltip appears next to the mouse cursor displaying the approximate record number you are scrolling past (Excel, Access). Sql server has the rownumbers on the Row Header column of its table view. Ideally, I would like to add row numbers to the Row Header column of the datagridview like sql server - Any suggestions...
7
15667
by: =?Utf-8?B?TG9zdEluTUQ=?= | last post by:
Hi All :) I'm converting VB6 using True DBGrid Pro 8.0 to VB2005 using DataGridView. True DBGrid has a MultipleLines property that controls whether individual records span multiple lines. Is there an equivalent property for the DataGridView? I have searched, but have not found one. I would like the user to be able to see all the columns of the table on one screen - thus eliminating the need to use the horizontal scroll bar to view...
1
2916
by: Chalkie | last post by:
Hello, I've hit what appears to be a serious problem with an unbound datagridview control that Ive added to a VB.Net program. Inadvertently I named one column 'Name' and a second 'Size'. The designer allowed me to do it but when I came to run the program the designer reported an error and looking at the error messages it it confusing the datagridview column with the form on which the control resides. I can't delete the datagridviw because...
0
3584
by: Bill Cart | last post by:
I have a datagridview that was created by dragging an SQL stored procedure onto the form. The SQL query has fields for Monday, Tuesday, etc. I am trying to set some of the values with the DefaultValuesNeeded event. When I right click on the control and select Edit Columns I can see a column that appears to be named Monday. The code is: private void spApplicantMealListDataGridView_DefaultValuesNeeded(object sender,...
1
1851
by: hughwarrington | last post by:
Hi there, I'd like to detect when the user resizes a column on a DataGridView by dragging the separator situated between columns. There is the ColumnWidthChanged event, but I can't find a way of distinguishing whether this was the result of the user dragging the separator, or one of the many other programmatic causes (columns being added/removed, my own auto-resizing code etc.). Any ideas? Many thanks in advance, Hugh
1
1975
by: RobcPettit | last post by:
Hi, on a form i have a splitcontair. In panel1 I have a list box. In panel2 I have a datagridview. I add data using dataset and the column number is always 10, but the row can be any number. Id like to know if its possible, when the known number of rows/columns are added if I can then snap the form to the datagridview size hieght, and width to include the listbox. I can do this manually but would be neet to do in the program. Regards...
0
2496
by: Peted | last post by:
Hello, Ive got a datagridview, on a splitcontainer, in a system.windows.forms.usercontrol. The datagrid view by default shows 3 colums of data and fills exactly the size of the user control form. This control is then called from another c# solution, and it displays fine when called and shown.
0
9843
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9683
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10630
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10275
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
9407
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
7811
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
5851
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4045
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3126
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.