Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Updated 18-May-11 21:41pm
v2
Comments
Sandeep Mewara 9-May-11 1:11am    
Not very clear. Please edit and elaborate a little.
Dalek Dave 19-May-11 3:41am    
Edited for Grammar, Syntax and Readability.

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
 
Share this answer
 
Comments
Dalek Dave 19-May-11 3:41am    
Seems Reasonable.
you can find any value from datagridview, based on which row you are clicking
.
for example
VB
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.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900