在Radgridview中使用href [英] using href in Radgridview

查看:108
本文介绍了在Radgridview中使用href的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让radgridview中的列包含链接(href)转到同一页面的另一个部分,把我不知道我在网格的哪一行,可以任何一个建议请!! div class =h2_lin>解决方案

< itemtemplate> 
将ASP:LinkBut​​ton的ID = 磅 RUNAT = 服务器 一项PostBackUrl = 文本= <%#的eval( FieldNameIfYouWantToGetFromDatabase )%> 中>< / ASP:LinkBut​​ton的>
< / itemtemplate>


使用它你可以得到你现在的行的索引



 Linkbutton btn =(Linkbutton)sender; 
GridViewRow gvr =(GridViewRow)btn.NamingContainer;
int index = gvr.RowIndex;


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 !!

解决方案

<itemtemplate>
<asp:linkbutton id="lb" runat="server" postbackurl="" text="<%# Eval("FieldNameIfYouWantToGetFromDatabase") %>"></asp:linkbutton>
</itemtemplate>            


use this you can get the index of the row you are now

Linkbutton btn = (Linkbutton)sender;
        GridViewRow gvr = (GridViewRow)btn.NamingContainer;
        int index = gvr.RowIndex;


这篇关于在Radgridview中使用href的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆