ASP.NET的GridView的rowIndex作为CommandArgument [英] ASP.NET GridView RowIndex As CommandArgument

查看:212
本文介绍了ASP.NET的GridView的rowIndex作为CommandArgument的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你怎么能访问和显示一个gridview项的行索引如在ButtonField字段列按钮命令参数?

 <&GridView的GT;
<柱体和GT;
   < ASP:ButtonField字段按钮类型=按钮
        的CommandName =编辑文本=编辑可见=真
        CommandArgument = /&GT??
.....


解决方案

下面是一个非常简单的方法:

< ASP:ButtonField字段按钮类型=按钮的CommandName =编辑文本=编辑可见=真
                 CommandArgument ='<%#Container.DataItemIndex%GT;' />

How can you access and display the row index of a gridview item as the command argument in a buttonfield column button?

<gridview>
<Columns>
   <asp:ButtonField  ButtonType="Button" 
        CommandName="Edit" Text="Edit" Visible="True" 
        CommandArgument=" ? ? ? " />
.....

解决方案

Here is a very simple way:

<asp:ButtonField ButtonType="Button" CommandName="Edit" Text="Edit" Visible="True" 
                 CommandArgument='<%# Container.DataItemIndex %>' />

这篇关于ASP.NET的GridView的rowIndex作为CommandArgument的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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