How to get Gridview Selected Row-Index?

 Posted by vishalneeraj-24503 on 11/22/2013 | Category: ASP.NET Interview questions | Views: 1853 | Points: 40
Answer:

With the help of Container.DataItemIndex, we can get Gridview Slected Row index.

For Example:-

In the ItemTemplate of Gridview, we can write:-

<ItemTemplate>
<asp:Button Id="btn_row_index" CommandName="View_Details"
CommandArguments = '<%# Container.DataItemIndex %>' Text="View Details"></asp:Button>
</ItemTemplate>


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response