如何在GridView中找到Out Row索引? [英] How To find Out Row index in GridView?

查看:93
本文介绍了如何在GridView中找到Out Row索引?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨....任何人都可以帮助我.......... Plzzzzzzzzz

Hi....Can Any One Help me..........Plzzzzzzzzz

推荐答案

在ASPX页面中:

In ASPX page:
<asp:gridview id="grd" onrowcommand="grd_RowCommand">
<columns>
<asp:templatefield>
    <itemtemplate>
		<asp:TextBox id="txtName" runat="server" />
        <asp:linkbutton id="btn" runat="server" text="Click" commandname="Click" />
    </itemtemplate>
</asp:templatefield>
</columns>
</asp:gridview>



代码隐藏


In Code-Behind

protected void grd_RowCommand(object sender, GridViewRowEventArgs e)
{
	if (e.Row.RowType == DataControlRowType.DataRow)
	{
		string name = e.Row.Cells[0].Text;
	}
}


这篇关于如何在GridView中找到Out Row索引?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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