Click here to Skip to main content
15,903,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In the first window there is a combobox named fruits; there is a linkLabel from which i can open a new Fruits window and enter new fruits name. But after closing that Fruits window the newly added fruits are not displayed in the main form combo box, though if i close the form and open it again i can get the names. But i want to display fruit name in the combobox of the main window as soon as i close the fruit window.

Please help me to solve this.
Thanks in advance.
Posted

1 solution

U Should create a function where u will add item to ComboBox,Now on Fruits windows after inserting new fruit name,In my opinion u r using add/ok/submit button to add new fruit name.On that button click event call ur comoboBox add function,so after every record added by u ,this function will be call and bcoz in that function u have written the functionality to add fruit name to comboBox so it will update,every time when a fruit name will insert.
 
Share this answer
 
v2
Comments
sahabiswarup 14-Dec-12 7:52am    
fruit details is in different window and fruit combo in different window, so how can i write that function in the submit button which is working on other window?
StackQ 14-Dec-12 7:57am    
Suppose:
Window1 contains ComboBox
Window2 contains SubmitButton (Where u r adding fruit name)
So create function to add item to comboBox, By defining public on window1
now on Window2:
create a object of window1 like->
Window1 objWindow1=new Window1();
Now on submitButton_Click Event call like below
//now call ur comboBox add functionality through object
objWindow1.UrComboBoxAdd_FunctionName();

try it and give me feedback.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900