Update 2 related froms on closing one of them
-
hi. I am writing a program with c# and sql as database. i have a MDIform as startup form which one of my form(frmMain) opens with it. in frmMain i have a combobox which is filled with data from CityTable. it means that I used Value Member and Display Member to fill it. when I press the button "Add City" on MDIform another form opens and i can add a new city. the frmMain still is open. my problem is here how can I update city Combo box in frmMain? please help me. i have asked from a few persons and they gave 2 solutions : 1-raise an event 2-open City From using showDialog() now please tell which one to choose and how?
-
hi. I am writing a program with c# and sql as database. i have a MDIform as startup form which one of my form(frmMain) opens with it. in frmMain i have a combobox which is filled with data from CityTable. it means that I used Value Member and Display Member to fill it. when I press the button "Add City" on MDIform another form opens and i can add a new city. the frmMain still is open. my problem is here how can I update city Combo box in frmMain? please help me. i have asked from a few persons and they gave 2 solutions : 1-raise an event 2-open City From using showDialog() now please tell which one to choose and how?
As per my knowledge, Do this. Make the data source(Table containing the Cities) of Combobox, publicly accessible by declaring in the mainForm a static propertly which return the data table of cities. In the dialog box, where you add new record, access the data table of mainForm and add city in it. It'll automatically shown in combo box because its already bound to that table. Regards
-
As per my knowledge, Do this. Make the data source(Table containing the Cities) of Combobox, publicly accessible by declaring in the mainForm a static propertly which return the data table of cities. In the dialog box, where you add new record, access the data table of mainForm and add city in it. It'll automatically shown in combo box because its already bound to that table. Regards