i have link button in grid view how to get row index [Resolved]

Posted by Jiturcm under ASP.NET on 4/20/2011 | Points: 10 | Views : 6585 | Status : [Member] | Replies : 2
i have link button in grid view how to get row index

jitendra kumar mahapatro


Responses

Posted by: Ndebata on: 4/20/2011 [Member] Starter | Points: 50

Up
0
Down

Resolved
Hi
in the click event of your button you can find the rowindex as bellow

int rindex=(((GridViewRow) (((LinkButton)(sender)).Parent.BindingContainer))).RowIndex


Thanks,
Debata

Jiturcm, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bugwee on: 4/20/2011 [Member] Starter | Points: 25

Up
0
Down
hi Jiturcm,

try to put this one in your grid views RowCommand.
 'to get the row index

Dim index As Integer = Convert.ToInt32(e.CommandArgument)

'to get the row data
Dim bug As GridViewRow = CType((e.CommandSource).Rows(index), GridViewRow)

'to get a particular data in the column
Dim wee As String = bug.Cells(0).Text


Regards,
Bugwee


Jiturcm, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response