0

Hi,
I have rowcommand function, in which i m obtaining sr_no as datakey from a link button. now i want to know which row was that. How to get row index this way ?

3
Contributors
4
Replies
11
Views
6 Years
Discussion Span
Last Post by shakeb@techwave
0

So im guessing that you have a LinkButton or something like that to trigger the rowcommand event.

I think i have used this before and it works.

int rowIndex = Convert.toInt32(e.CommandArgument);

if that one above dont work you can try this lets say again that the rowcommand is trigger by a linkbutton you will do this.

GridViewRow row = (GridViewRow)((LinkButton)e.CommandSource).NamingContainer;
int rowIndex = row.RowIndex;

Edited by jbisono: n/a

0

I think Jibsosn is answered!!!! he is right try later one code --it may be return index from 0 to onwords
then you can find out the rows
Thnx Shakeb Ahmad Khan

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.