Joomla!(TM) Development Services | Portland, OR | Social Media Services - Salyris Studios

9:57 AM 3 Comments

Check them out pretty awesome studio! :)
Joomla!(TM) Development Services | Portland, OR | Social Media Services - Salyris Studios

3 comments:

C# & ASP.Net: Get the Row Index from a ASP.Net GridView's RowCommand event.

6:55 PM 0 Comments


I have used this before and it works.
  1. int rowIndex = Convert.toInt32(e.CommandArgument);

If that one above doesn't work you can try this. Lets say that the rowcommand is triggered by a linkbutton you would do to get the row index. 
  1. GridViewRow row = (GridViewRow)((LinkButton)e.CommandSource).NamingContainer;
  2. int rowIndex = row.RowIndex;
Source: http://www.daniweb.com/web-development/aspnet/threads/363842/how-to-get-rowindex-of-gridview-using-datakey-obtained-in-rowcommand

0 comments: