Results 1 to 7 of 7

Thread: from datagrid in one form to a textbox in another form

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2004
    Posts
    29

    from datagrid in one form to a textbox in another form

    this is a major major problem for me...i could fail my module if i dont implement this in my system!!

    i've downloaded some examples from this site but i could not understand whats it doing..and how to implement it in my forms..im hoping some one out there can help me out here...it'll be one reall really appreciated help.

    anyways this is my situation, i have frmQueue which has a datagrid showing only one column (ACCT ID) and another form named frmDiagnosis which has got a textbox called txtACCTID. the user clicks on the first cell in the datagrid in frmQueue and it gets loaded in the textbox in frmDiagnosis.

    pls some one help me here. im new to C# so the examples really make me feel blur...
    Arvinder Gill

  2. #2
    Addicted Member
    Join Date
    Jun 2003
    Location
    Birmingham, AL
    Posts
    188
    Question, is the problem getting the account id from the grid or is the problem displaying the data in the other form?

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Feb 2004
    Posts
    29

    from datagrid in one form to a textbox in another form

    its passing the data to the other which is the prblem, hope u can help me out here tewl

    thx in advance
    Arvinder Gill

  4. #4
    Addicted Member
    Join Date
    Jun 2003
    Location
    Birmingham, AL
    Posts
    188
    is frmDiagnosis opened from frmQueue or visa vera or is there a third form?

    You could try passing a reference of the other form in the constructor.

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Feb 2004
    Posts
    29
    frmQueue is opened from frmDiagnosis.

    thx for the hint tewl..but if u dont mind could u show me an example with simle coding of the constructor??. im kinda new to the programming world
    Arvinder Gill

  6. #6
    Addicted Member
    Join Date
    Jun 2003
    Location
    Birmingham, AL
    Posts
    188
    frmQueue

    Code:
    // Reference variable
    
    // When you want to add text to txtACCTID
    // do parent.txtACCTID.Text = whatever
    
    private frmDiagnosis parent;
    // constructor
    public frmQueue(frmDiagnosis p)
    {
          this.parent = p;
    }
    frmDiagnosis open frmQueue

    Code:
      // Open frmQueue passing reference of the frmDiagnosis
      frmQueue f = new frmQueue(this);
      f.Show();
    that help?

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Feb 2004
    Posts
    29

    YAHOO!

    thx Tewl...that helped??....IT WORKED!!!!...thx again!!!
    Arvinder Gill

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width