怎样更改GridView里Select Button的Text
来源:互联网 发布:火爆网络的女神雅典娜 编辑:程序博客网 时间:2024/04/29 19:07
在GridView里加入一个属性AutoGenerateSelectButton="True",在表格的前边就会显示出一个Select按钮。怎么样改变按钮的显示标题呢?我们在数据邦定之后进行修改。我在网上搜来的结果是:
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { GridViewRow row = (GridViewRow)e.Row; TableCell selectCell = row.Cells[GridView1.SelectedIndex]; //error if (selectCell.Controls.Count > 0) { LinkButton selectControl = selectCell.Controls[0] as LinkButton; if (selectControl != null) { selectControl.Text = "Click Me"; } } } 但提示说SelectedIndex出错。后来发现GridView里的SelectedIndex=-1,可能是这里的问题。因此我把出错的语句改成 TableCell selectCell = row.Cells[0]; 就好了。当然那个Select按钮必须在第一列才可以。
- 怎样更改GridView里Select Button的Text
- GridView里的Button
- GridView里的 checkbox 和button
- GridView里的Button控件用法
- 应用里的用户头像是怎样更改的?
- 怎样在gridview里添加其他的控件?
- 怎样得到select所有option里的值
- 修改button的text
- select怎样加value和text值
- jquery select 怎样正确取道text值
- 怎么让input里的text和button使用不同的css样式
- Scott Mitchell 的ASP.NET 2.0数据教程之二十八:: GridView里的Button
- Scott Mitchell 的ASP.NET 2.0数据教程之二十八:: GridView里的Button
- Scott Mitchell 的ASP.NET 2.0数据教程之二十八:: GridView里的Button
- Scott Mitchell 的ASP.NET 2.0数据教程之二十八:: GridView里的Button
- 获取select的text
- gridview里模板列使用textbox、button赋值取值,以及全选按钮的使用
- Select Single Radio Button in Gridview in Asp.Net
- 软件开发资深人士的经验总结
- 微软基础类库MFC概述
- MPM--apache的工作模式
- 微软,Google面试题 (18) —— 用两个栈实现一个队列
- 并不是所有人都像张楚这样
- 怎样更改GridView里Select Button的Text
- 2群殴是暗示大家萨哈夫idhnjkhddushjds
- INFO[org.hibernate.type.SerializableType] - could not read column value from result set: srulaaaId13_; could not deserialize
- 转:莫大看盘
- 他们玩的不是游戏,而是寂寞
- 判断是否为undefined 类型
- 当前日期加1 日期控件calendar
- MFC全屏显示OpenGL窗口的简易操作
- 关于恢复输入法图标