Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Update 2 related froms on closing one of them

Update 2 related froms on closing one of them

Scheduled Pinned Locked Moved C#
databasehelpquestioncsharpannouncement
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Shaahinm
    wrote on last edited by
    #1

    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?

    A 1 Reply Last reply
    0
    • S Shaahinm

      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?

      A Offline
      A Offline
      Aftab Sindhi
      wrote on last edited by
      #2

      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

      S 1 Reply Last reply
      0
      • A Aftab Sindhi

        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

        S Offline
        S Offline
        Shaahinm
        wrote on last edited by
        #3

        thanx for answer appreciate

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups