after pulling the data into the datagrid. how can i make the cell clickable ,like if i select any cell ,the new form should come up.
im using ms access 2007:wave:
Printable View
after pulling the data into the datagrid. how can i make the cell clickable ,like if i select any cell ,the new form should come up.
im using ms access 2007:wave:
vb Code:
Private Sub DataGridView1_CellClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick 'this where you have clicked 'i have added an button column to the grid MessageBox.Show("Here is your row id " & e.RowIndex & Environment.NewLine & " Here is column indes " & e.ColumnIndex) If e.RowIndex = 0 And e.ColumnIndex = 0 Then 'here you will open a nrew form 'so the condition is 'if the row is 0, and column is 0 that means if the user 'clicks on specific cell 'then open some form MessageBox.Show("Ypur form is opened here") End If End Sub
okey its fine.
actually i have enabled sorting in the datagridview. if i code using above code then after sorting the cells
will be same but data in there will be sorted accordingly. for instance if on the top there is a name " abc" and after sorting there may be "zdt" ,now if person click on "zdt" he will get data of "abc". i have you get the point. any solution for this?
thanx anyway
I sorted out this problem, thank you . I am writing it here for others who has the same problem as me.
DataGridView1.CurrentRow.Cells("DataGridViewTextBoxColumn").Value