Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB9.0 VB.NET
How do I send and use values in datagridview at support form into maskedTextBox at Main Form in event click datagridview and what method I use for it?
Please help me
 
Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
    Dim i As Integer
    Dim a, b, c As String
    Dim _SPP As New SSPForm
    a = Me.DataGridView1(0, i).Value.ToString
    b = Me.DataGridView1(1, i).Value.ToString
    c = Me.DataGridView1(2, i).Value.ToString
    i = DataGridView1.CurrentRow.Index
    With _SPP
        .m_oMAP.Text = a & "." & b
        .m_oDescription.Text = c
    End With
    Me.Hide()
End Sub
Posted 8-May-11 18:16pm
Edited 18-May-11 22:41pm
v2
Comments
S Mewara at 9-May-11 1:11am
   
Not very clear. Please edit and elaborate a little.
Dalek Dave at 19-May-11 3:41am
   
Edited for Grammar, Syntax and Readability.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

As Per me This Must Be a Simple Task
According to what I understand about Your
Need
Try This and Please Get Me know your Feedback.
 
Let us Suppose Form1 is your Support Form Containing
The dataGridview having the Related Data
And Form2 be Your main Form Containing the TextBox
 
Inside Form1 means in your Support Form
under dataGridView_CellContentClick
Write The Following Code like
 
MainformName.TextBoxName1.Text=dataGridView.SelectedCells.Item(0).Value.ToString()
MainformName.TextBoxName2.Text=dataGridView.SelectedCells.Item(1).Value.ToString()
 

 
Implement this As Per Your need
  Permalink  
Comments
Dalek Dave at 19-May-11 3:41am
   
Seems Reasonable.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

you can find any value from datagridview, based on which row you are clicking
.
for example
Dim invoiceIdTick As String = DataGridView1.Rows(e.RowIndex).Cells(2).Value.ToString()
 
write your code on DataGridView1_CellContentClick event. From event e you can find the row index and all its column value.
 
I think this will help you.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 400
1 Jochen Arndt 200
2 Richard MacCutchan 135
3 DamithSL 95
4 Maciej Los 95
0 OriginalGriff 6,045
1 DamithSL 4,601
2 Maciej Los 4,032
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,220


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 19 May 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100