DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   VB.NET (http://www.daniweb.com/forums/forum58.html)
-   -   Related To datageidview (http://www.daniweb.com/forums/thread163184.html)

manoj_582033 Dec 20th, 2008 2:00 am
Related To datageidview
 
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

cikara21 Dec 20th, 2008 3:23 am
Re: Related To datageidview
 
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

manoj_582033 Dec 20th, 2008 5:04 am
Re: Related To datageidview
 
Thanks It's Working


All times are GMT -4. The time now is 11:56 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC