Click here to Skip to main content
12,998,363 members (55,394 online)
Rate this:
Please Sign up or sign in to vote.
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
End Sub
Posted 8-May-11 17:16pm
Updated 18-May-11 21:41pm
Dalek Dave433.3K
S 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.
Rate this: bad
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
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


Implement this As Per Your need
Dalek Dave 19-May-11 3:41am
Seems Reasonable.
Rate this: bad
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.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170622.1 | Last Updated 19 May 2011
Copyright © CodeProject, 1999-2017
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