How can I open a form in datagrid cell click
In my project I have a report form to view all the details of one particular form. In this report form I can view all the data's of that particular form in datagridview. During this process I want to open that particular form in datagrid cell click . How can I do this process in c# windows application.Is there any possible to do this. Anybody can help this.


Blackbarbie Bb56 reputationPosted Sep 2, 2015, 10:23 PM EDT
'assume you have 3 column in the datagridview, the new form named form2. If the column is dinamic, you can use array.
Private Sub DataGridView1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGridView1.Click
Dim int As Integer = Me.DataGridView1.CurrentCell.RowIndex
Form2.Label1.Text = Me.DataGridView1.Item(0, int).Value
Form2.Label2.Text = Me.DataGridView1.Item(1, int).Value
Form2.Label3.Text = Me.DataGridView1.Item(2, int).Value
Form2.Show()
End Sub
Pavithra LRank #4,546 · 338 reputationPosted Sep 2, 2015, 10:29 PM EDT
Pavithra LRank #4,546 · 338 reputationPosted Sep 2, 2015, 10:50 PM EDT
Pavithra LRank #4,546 · 338 reputationPosted Sep 2, 2015, 11:09 PM EDT
Blackbarbie Bb56 reputationPosted Sep 2, 2015, 10:47 PM EDT