0

I have one DataGridViewComboBoxColumn in FormA, and I have a button that opens another FormB which enable user from adding a new item. When the user add a new item, it will not appear until you reopen formA, I want the added item to appear directly, how can I do this? thank you in advance. Following is my code:

Following is the code in FormB:

   DataGridViewComboBoxColumn itemCmbClmn = new DataGridViewComboBoxColumn();

            itemCmbClmn.ValueMember = itemID.ToString();
            itemCmbClmn.DisplayMember = txtItemAr.Text;

            BindingSource bs = new BindingSource();
            DataTable itemDataTable = prcFrm.ItemData;
            bs.DataSource = itemDataTable;
            itemCmbClmn.DataSource = bs;

The added item will appear but you need to reopen the form, any help please?

jotnarta
  • 1
  • 1
  • shouldnt it just be bs.Datasource = prcFrm.ItemData; You need to make sure that your updatng the same object in memory between the two forms. – Derek Nov 18 '15 at 16:15
  • Thank you. In other situation, I re-called the function that populate the combobox, but the same, the value is not displayed until I close and reopen the form .. :\ – jotnarta Nov 18 '15 at 16:31
  • How Can I get the same object in memory between the two form, sorry, I am new to Visual Studio and C#, any help please? – jotnarta Dec 01 '15 at 09:11

0 Answers0