更改在asp.net中一个gridview的自动生成的选择列文本 - 如何? [英] Changing text of an autogenerated select column of a gridview in asp.net - How?

查看:179
本文介绍了更改在asp.net中一个gridview的自动生成的选择列文本 - 如何?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想改变自动生成的选择列的文本在ASP.NET 的GridView 控制。该文本需要被改变的值数据字段

I would like to change the text of the autogenerated "select" column in an ASP.NET GridView control. The text needs to be changed to the value of a DataField.

我怀疑有做这是一个非常合乎逻辑的方式,但我很想念它。 我能够通过$ P $添加控件和数据对呈现事件,而是有更简单更好的办法?

I suspect that there is a very logical way to do this but I am missing it. I am able to add controls and data via the pre-render event but is there an easier better way?

推荐答案

使用的模板列并放入它的按钮或linkbuttons适当的CommandName属性:<一href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.buttonfield.commandname.aspx">ButtonField.CommandName物业 您可以使用的DataBinder.Eval方法设置此按钮上的文字。

Use the TemplateField and place into it buttons or linkbuttons with appropriate CommandName property: ButtonField.CommandName Property You may set this button text using DataBinder.Eval method.

这篇关于更改在asp.net中一个gridview的自动生成的选择列文本 - 如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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