gridview_RowCommand 获取当前行中的控件
2013-07-05 09:31
489 查看
<asp:GridView ID="gvStorglog" runat="server" Width="100%" SkinID="gridviewSkin" AutoGenerateColumns="false"
OnRowCommand="gvStorglog_RowCommand">
<Columns>
<asp:TemplateField HeaderText="操作">
<ItemTemplate>
<asp:LinkButton ID="lbEdit" runat="server" CommandName="Modify" CommandArgument='<%# Eval("PC_ID")%>'>退单</asp:LinkButton>
</ItemTemplate>
<ItemStyle HorizontalAlign="left" Wrap="false" />
</asp:TemplateField>
<asp:BoundField DataField="PC_CODE" HeaderText="企业名称"></asp:BoundField>
<asp:TemplateField HeaderText="企业名称">
<ItemTemplate>
<asp:TextBox CssClass="inputStyle" Width="94%" Text='<%#DataBinder.Eval(Container.DataItem, "PC_NAME")%>'
ID="txtPC_NAME" runat="server"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
protected void gvStorglog_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (!string.IsNullOrEmpty(e.CommandArgument.ToString()))
{
TextBox text = (TextBox)((Control)e.CommandSource).FindControl("txtPC_NAME");
string aa = text.Text.ToString();
}
}
OnRowCommand="gvStorglog_RowCommand">
<Columns>
<asp:TemplateField HeaderText="操作">
<ItemTemplate>
<asp:LinkButton ID="lbEdit" runat="server" CommandName="Modify" CommandArgument='<%# Eval("PC_ID")%>'>退单</asp:LinkButton>
</ItemTemplate>
<ItemStyle HorizontalAlign="left" Wrap="false" />
</asp:TemplateField>
<asp:BoundField DataField="PC_CODE" HeaderText="企业名称"></asp:BoundField>
<asp:TemplateField HeaderText="企业名称">
<ItemTemplate>
<asp:TextBox CssClass="inputStyle" Width="94%" Text='<%#DataBinder.Eval(Container.DataItem, "PC_NAME")%>'
ID="txtPC_NAME" runat="server"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
protected void gvStorglog_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (!string.IsNullOrEmpty(e.CommandArgument.ToString()))
{
TextBox text = (TextBox)((Control)e.CommandSource).FindControl("txtPC_NAME");
string aa = text.Text.ToString();
}
}
相关文章推荐
- gridview绑定checkbox控件后,通过单击CheckedChanged事件获取当前选择行的数据
- ASP.NET DEMO 5:如何在GridView的RowCommand事件中获取当前的GridViewRow
- GridView,DataList控件获取当前行的行号
- GridView的RowCommand事件中获取每行控件的值
- 如何在GridView的RowCommand事件中获取当前的GridViewRow
- ASP.NET2.0中的GRIDVIEW控件在使用TemplateField中的LinkButton时如何在RowCommand事件中找到当前行index的方法
- GridView,DataList控件获取当前行的行号
- GridView,DataList控件获取当前行的行号
- 如何在GridView的RowCommand事件中获取当前的GridViewRow
- GridView,DataList控件获取当前行的行号
- GridView.RowCommand 事件中获取当前行的信息
- GridView,DataList控件获取当前行的行号
- 如何在GridView的RowCommand事件中获取当前的GridViewRow
- ASP.NET2.0中的GRIDVIEW控件在使用TemplateField中的LinkButton时如何在RowCommand事件中找到当前行index的方法
- ASP.NET2.0中的GRIDVIEW控件在使用TemplateField中的LinkButton时如何在RowCommand事件中找到当前行index的方法
- GridView,DataList控件获取当前行的行号
- 如何在GridView的RowCommand事件中获取当前的GridViewRow
- 详解GridView控件获取当前行的索引值的
- 不使用GridView自带编辑删除等等按钮,放置服务器控件的按钮。获取点击按钮的当前行以便进行编辑删除
- GridView控件RowDataBound事件中获取列字段的几种途径