0

Hi Friends

I am using a datagridview, there are four columns in that, & on fourth cell i have a button field, when i click on that i want to get the text of item(0) of selected row.

please help me to solve this

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by manoj_582033
0

HINT : :)

Dim sel_row_index As Integer
Dim sel_col_index As Integer

Private Sub DataGridView1_CellClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellClick
        sel_row_index = e.RowIndex
        sel_col_index = e.ColumnIndex
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        MessageBox.Show(DataGridView1.Item(sel_col_index, sel_row_index).Value.ToString)
End Sub
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.