24-06-17, 12:46 AM
كود :
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'MDataSet.table1' table. You can move, or remove it, as needed.
Me.Table1TableAdapter.Fill(Me.MDataSet.table1)
Table1DataGridView.MultiSelect = False
Table1DataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect
End Sub
Private Sub Table1DataGridView_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles Table1DataGridView.CellContentClick
If e.ColumnIndex = 3 Then
Dim i As Integer = Table1DataGridView.CurrentRow.Index
Form2.Table1BindingSource.Filter = "id_name=" & Table1DataGridView.CurrentRow.Cells(0).Value
Form2.ShowDialog()
Me.Table1TableAdapter.Fill(Me.MDataSet.table1)
Table1DataGridView.Rows(i).Cells(3).Selected = True
End If
End Sub
End Class