473,406 Members | 2,707 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,406 software developers and data experts.

Passing Data Back to Main form. C#

122 100+
I have a scenario i am not sure how to code it. Basically i have a Main form that has a datagrid of objects. I want to click a button on this form that will load a second form that will allow the user to pick a third form to be created. Once this third from is created i want to add this newly created object back to an object list on the main form that is linked to the datagrid.

Any help would be much appreciated.

It is holdning me up on a time sensative project so i appreciate anyone who can respond quickly.

thanks,
Aug 21 '08 #1
3 1773
rjvrnjn
26
Basically i have a Main form that has a datagrid of objects. I want to click a button on this form that will load a second form that will allow the user to pick a third form to be created. Once this third from is created i want to add this newly created object back to an object list on the main form that is linked to the datagrid.
I think you need to divulge a bit more information here. The datagrid holds what kind of objects? What exactly you mean when you say a third form is created? Is the user dragging and dropping controls to create the layout of the 3rd form and you need to save that as a serialized object?
Aug 21 '08 #2
DragonLord
122 100+
Ok I don't think the type of object matters. But if you say you need an better example lets do this.

Main form contains a datagrid with a list of people.

(Object Person)

now the user wants to add another person to the list.
clicks <new> button. a form opens up with a dropdown list with more specific types of people. Objects that inherit from the orginal Person object.
user selects say teacher.

Form 3 opens up and allows the user to specify thing such as name, age, sex and more specific qualities of a teacher.

I then want to take that newly created object (teacher) an add it to the list of people in the datagrid.

Hope this helps.
Aug 21 '08 #3
rjvrnjn
26
now the user wants to add another person to the list.
clicks <new> button. a form opens up with a dropdown list with more specific types of people. Objects that inherit from the orginal Person object.
user selects say teacher.
Form 3 opens up and allows the user to specify thing such as name, age, sex and more specific qualities of a teacher.
I then want to take that newly created object (teacher) an add it to the list of people in the datagrid.
Yes, certainly this example makes things easier to understand.
From what I understand you can bind the datagrid using BindingManagerClass with your custom class object. Your class needs to implement IList/IComponent (based on what you want). Then on click of save of the 3rd form update the Object and the datagrid will be updated with the new record. This article gives an overview of the CurrencyManager & BindingManager class (to get started).
Aug 22 '08 #4

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

Similar topics

5
by: Jack | last post by:
Hi, I need to pass multple variables in a link in order to go to a asp page with the two varables. The following are the values of the variables using response.write: <%'Response.Write Mypage...
8
by: Johnny | last post by:
I'm a rookie at C# and OO so please don't laugh! I have a form (fclsTaxCalculator) that contains a text box (tboxZipCode) containing a zip code. The user can enter a zip code in the text box and...
22
by: Arne | last post by:
How do I pass a dataset to a webservices? I need to submit a shoppingcart from a pocket PC to a webservice. What is the right datatype? II have tried dataset as a datatype, but I can't get it to...
2
by: mark.e.nelson | last post by:
Hi, I am trying to pass a pointer to a struct to a function that uses the data in the struct, and also happens to use ncurses. I always get a segmentation violation when the program exits. I...
9
by: itarizin | last post by:
Today I found as ignorance owe me.. Let me explain what I'm tring to do and fail (fail: in my needs) For example, I've my stupid class: public class Hello { private int x = 0; public...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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...
0
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...
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.