You must Sign In to post a response.
  • Category: Windows

    Bind combobox of Normalform by selecting from Masterform combo

    There is combobox1 in MasterForm and combox2 in Normalform
    NormalForm is deriving from MasterForm

    On combobox1selectedIndexchanged event, loading data for combox2
    MasterForm.cs
    public void combobox1selectedIndexchanged (object sender,event e)
    {
    NormalForm nf=new NormalForm()
    nf.NormalForm_Load(nf, EventArgs.Empty);
    }
    -----
    NormalForm.cs : MasterForm
    public void NormalForm_Load(obj sender,events e)
    {
    //binding combobox
    }

    Thou at breakpoint in nf in Masterform, I could see combobox datasource value, its not binding inside combo.. What could be the problem
  • #770092
    Hi Lily,

    You can achieve it by using the below code.

    public void combobox1_selectedIndexchanged (object sender, event e)
    {
    NormalForm nf=new NormalForm(combobox1.Text);
    nf.Show();
    }

    constructor in normal form.
    public NormalForm(string value1)
    {
    combobox2.Text = value1;
    }

    You can achieve this by using the constructor of normal form in the Master form.

    Hope it will help you.

    Regards,
    Nirav Lalan
    DNS Gold Member
    "If you can dream it, you can do it."


  • Sign In to post your comments