Click here to Skip to main content
15,889,808 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi guys,

i have form where user select item from dropdown list then fill the quantity of the item.he will select item as many as he want.after finish select the items and fill the quantity of each item, then i want a popup window appear (click button)to see the list that he entered before.if he satisfy then click ok,but if he not satisfy with the list item he can clear the item that he dont want.then after he do that, back to parent window to click submit button to database to insert all the data.

thanks in advance.hope anyone can help me on this.

musiw.
Posted
Comments
kornakar 13-Jul-12 1:39am    
http://www.whathaveyoutried.com/
graciax8 13-Jul-12 1:39am    
what progress have you done so far? have you able to make a child popup window and pass a value to the parent window? have you got any codes already?
musiw 13-Jul-12 4:25am    
tq for reply.i dont know how to pass to popup window.i manage to build form and display all the dropdown list item and the quantity.the problem stuck on the popup window and to pass value

1 solution

There are numerous ways to accomplish this. Here are a couple:

1.) You could create a custom form with a constructor that takes your list as a parameter and assigns it to a private variable. Use this private variable as the source of what you display:
C#
public class PopupWindow : Form
{
    private List<T> selected_list = new List<T>();

    public PopupWindow(){ InitializeCompnent(); }

    public PopupWindow( List<T> passed_in ) : this()
    {
        this.selected_list = passed_in;
    }
}


2.) Another way is to create your form with a public property that you can assign your list to after instantiation. The property would assign to a private variable, which would be the source of your display:
C#
public class PopupWindow : Form
{
    private List<T> selected_list = new List<T>();

    public PopupWindow(){ InitializeCompnent(); }

    public List<T> SelectedItemList
    {
        get { return this.selected_list; }
        set { this.selected_list = value; }
    }
}


You will need to replace List<T> with whatever your list of selected items is in these examples.
 
Share this answer
 
v2

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