473,396 Members | 1,967 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Change DataGridView in other form

Hello there,

I have these forms:
- Main
- Add row

I'd like to add a datagridview row from Form2 in the datagridview in Form1, how do I do this?

Thanks, Bob
Sep 16 '07 #1
3 1093
vanc
211 Expert 100+
Hello there,

I have these forms:
- Main
- Add row

I'd like to add a datagridview row from Form2 in the datagridview in Form1, how do I do this?

Thanks, Bob
Assumption that you create Form2 at Form1, so you have reference to From2. Make AddRow method public and you can call AddRow(var,var,var,var) in Form1 then. Is it the case?

cheers.
Sep 16 '07 #2
I Mean this:
http://www.game-experts.nl/example.zip

I quickly created 2 forms:

- Form1 contains a checkbox (checkBox1) and must be checked with a button in Form2, which is created in Form1 (Form2 newwindow = new Form2();
newwindow.Show(); )
Well, I'm a noobie so just check out te zip please (A)

thanks
Sep 17 '07 #3
vanc
211 Expert 100+
I Mean this:
http://www.game-experts.nl/example.zip

I quickly created 2 forms:

- Form1 contains a checkbox (checkBox1) and must be checked with a button in Form2, which is created in Form1 (Form2 newwindow = new Form2();
newwindow.Show(); )
Well, I'm a noobie so just check out te zip please (A)

thanks
In this case From2 has no reference to Form1. I recommend you read about delegate. It should help you in your case by pass a delegate to Form2, then when button get Clicked it will fire this delegate back to Form1 and perform what you want it to do and heaps more. If you can not understand, please contact me again.

http://msdn2.microsoft.com/en-us/library/ms173171(VS.80).aspx

cheers.
Sep 18 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Matt | last post by:
Another interesting issue: I set the default font on most of my forms to what I want the text in my controls to show up as (say, Verdana 9pt.), and then just change the font on labels and buttons...
10
by: rob | last post by:
I have a class that among others exposes a string property "Date". The date in this property is stored in the form yyyymmdd. Now I do the following 1) Generate a DataGridViewTextBoxColumn column...
1
by: Bob | last post by:
During a form's development I noticed that when I changed bound dataset defintions with the dataset designer (for instance adding a column to one), when I come back and look at the form the...
1
by: mark carew | last post by:
Hi, Problem - An extra column to the left (even with row headers disabled) ---------------------------------------------------------- Apologies if this posting is already in the newsgroup; but...
3
by: steve | last post by:
Hi All How can I get the datagridview to redraw after changing the rowtemplate.height at runtime ( it is databound to a datatable) I have tried datagridview1.refresh etc to no avail (The row...
4
by: Martin Arvidsson | last post by:
Hi! I have used the SqlCommand and DataReader to read data to a DataSet This dataset is the used to set the properties; DataMember and DataSource of the DataGridView. Now what i want to do is...
7
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...
4
by: =?Utf-8?B?UmljaA==?= | last post by:
On a form - I have a datagridview which is docked to the entire form. The datagridview allows users to Delete and/or Add Rows. On the Form_Load event I Fill the datagridview source table with a...
1
by: Karl | last post by:
Hi all... This is a good one. You'll like this... I am working on a course management tool that allows certain Courses to be cross referenced with Job Roles and, when they are, whether the...
0
by: Andrus | last post by:
I tried to use modeless picklist for DataGridView custom ComboBoxColumn without success. Steps to reproduce issue: 1. Run code 2. Enter some character 3. Press Tab Observed:
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...
0
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,...

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.