Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am trying to make column in radgridview contain link (href) to go to another part at the same page , put i can't know i am at which row on the grid , can any one advice please !!
Posted

<itemtemplate>
<asp:linkbutton id="lb" runat="server" postbackurl="" text="<%# Eval("FieldNameIfYouWantToGetFromDatabase") %>"></asp:linkbutton>
</itemtemplate>            
 
Share this answer
 
v2
Comments
eman88 11-May-13 9:28am    
thank You for your answer but its not what i asked for !! my question is how to go to another part at the same page using link btn in gridview , i searched and found that i can do that by using href and its working for me but the problem is i don't know what row i click on !!
use this you can get the index of the row you are now

C#
Linkbutton btn = (Linkbutton)sender;
        GridViewRow gvr = (GridViewRow)btn.NamingContainer;
        int index = gvr.RowIndex;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900