GridView Button Textbox TemplateField 取行号
来源:互联网 发布:永恒战士4网络连接失败 编辑:程序博客网 时间:2024/05/29 03:15
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" >
<Columns>
<asp:TemplateField HeaderText="Test">
<ItemTemplate>
<asp:Button ID="Button1" runat="server" Text="USE" OnClick="Button1_Click" CssClass="b" />
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" VerticalAlign="Top" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Textbox">
<ItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("UserName") %>'></asp:TextBox>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" VerticalAlign="Top" />
</asp:TemplateField>
</Columns>
</asp:GridView>
protected void Button1_Click(object sender, EventArgs e)
{
int index = ((GridViewRow)(((Button)sender).Parent.Parent)).RowIndex;
TextBox tb=(TextBox)GridView1.Rows[index].Cells[1].FindControl("TextBox1");
int s = Convert.ToInt32(tb.Text) + 1;
tbox.Text = s.ToString();
}
}
- GridView Button Textbox TemplateField 取行号
- GridView 与Button 取行号
- GridView 与Button 取行号
- asp.net GridView 中TemplateField中的Button或buttonlink控件点击后获得选中的GridView 行号
- gridview里模板列使用textbox、button赋值取值,以及全选按钮的使用
- GridView动态创建templateField
- asp.net取GridView中的行号
- GridView中TemplateField的使用
- Jquer GridView内嵌 DropDownList 和 TextBox 取值
- 在GridView控件中使用TemplateField
- 在GridView控件中使用TemplateField
- GridView动态创建模板列templateField
- 获取GridView的TemplateField模版中某列值
- 在GridView控件中使用TemplateField
- GridView中BoundField与TemplateField的区别
- GridView中BoundField与TemplateField的区别
- 【玩转GridView】之TemplateField模板
- Asp .NET使用控件常见问题大全(设计时选中、Button、TextBox、DropDownList、GridView、UpdatePanel 等)
- xinkusile
- shell取本机的IP地址
- [XML]JAVA解析XSD,并根据选择节点生成XSL
- excel 同一工作表中非连续区域中筛选唯一值 (VBA代码)
- BlackBerry南非世界杯应用让你随身携带世界杯
- GridView Button Textbox TemplateField 取行号
- 队列振铃策略(ring strategy)说明和asterisk 电话监听
- v4l Invalid argument 问题
- 关于CSS中内层使用float导致外层的背景无法显示的问题的解决
- Linux环境下的Java开发:体验Eclipse
- 关于typeof
- mapXtreme for java测距仿于51地图测距(前台部分,用JQuery + dwr + vml)
- oracle中优化SQL语句
- Ubuntu aptitude安装可用的软件包