Hi, I have 2 links within a datagridview. The 2 links are in the same row, let say link A and link B. How to let link A go to Form A and link B go to Form B?

Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick           
        
        Me.Hide()
        Dim rs As New RstMaintain
        rs.Show()


    End Sub

My coding above just able to go to one form, but I have no idea to make the 2 links go to different form. Hope someone can help me..

Problem solved.

if that code has no error then try to make two forms show..i mean declare another variable for the 2nd form and make it show

ahhh ok.

had u got the solution.....

yes, the solution as below:

Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick

        If e.ColumnIndex = 0 Then  'for first column

            Me.Hide()
            Dim rs As New RstMaintain
            rs.Show()

        ElseIf e.ColumnIndex = 7 Then  'for 6th column

            Me.Hide()
            Dim rs1 As New QC2b
            rs1.Show()

        End If

yeah the rite solution.... Gud Going ...:)

Nice sharing information =)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.