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. Grid

Grid

Scheduled Pinned Locked Moved C#
csstutorialquestion
4 Posts 3 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.
  • M Offline
    M Offline
    Muhammad Waqas Butt
    wrote on last edited by
    #1

    I have two forms Form1 and Form2. In form1 i have a grid control and a button. On button click form2 open. In form2 i have two textboxes & a button (Insert Value). I want when i click on form1 button form2 opens and i fill all values and then i click form2 button (Insert) all values insert in grid control and form2 close. Does any body know how to do this? MUHAMMAD WAQAS BUTT

    C M 2 Replies Last reply
    0
    • M Muhammad Waqas Butt

      I have two forms Form1 and Form2. In form1 i have a grid control and a button. On button click form2 open. In form2 i have two textboxes & a button (Insert Value). I want when i click on form1 button form2 opens and i fill all values and then i click form2 button (Insert) all values insert in grid control and form2 close. Does any body know how to do this? MUHAMMAD WAQAS BUTT

      C Offline
      C Offline
      chriswalshie
      wrote on last edited by
      #2

      MUHAMMAD, From memory this is not really pleasant, But you need to create a new instance of Form1 to be able to programatically controll it and its values. Because the first instance of form1 has nothing to do with form2. If ne one has a better solution please let me know, because i dont like the work around. Thanks Chris

      C 1 Reply Last reply
      0
      • C chriswalshie

        MUHAMMAD, From memory this is not really pleasant, But you need to create a new instance of Form1 to be able to programatically controll it and its values. Because the first instance of form1 has nothing to do with form2. If ne one has a better solution please let me know, because i dont like the work around. Thanks Chris

        C Offline
        C Offline
        chriswalshie
        wrote on last edited by
        #3

        MUHAMMAD, Have u thought of using TAB pages? Chris

        1 Reply Last reply
        0
        • M Muhammad Waqas Butt

          I have two forms Form1 and Form2. In form1 i have a grid control and a button. On button click form2 open. In form2 i have two textboxes & a button (Insert Value). I want when i click on form1 button form2 opens and i fill all values and then i click form2 button (Insert) all values insert in grid control and form2 close. Does any body know how to do this? MUHAMMAD WAQAS BUTT

          M Offline
          M Offline
          Mr Cooper
          wrote on last edited by
          #4

          You can use any solution of the follows: 1.make all textBoxes in form2 Public (not private), and then from from1 you can access all textBoxes in form2-the OK button now is just used to close the form. 2.You can create an array(public in form2) of length=the number of textBoxes u have in form2 and the OK button fills this array then closes the form, then from form1 you can access this array.

          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