在Gridview控件中使用模板列显示数据,怎样在后台获取itemtemplate中编辑之前的数据
1个回答
展开全部
<asp:GridView ID="GridView1" runat="server" OnRowCancelingEdit="GridView1_RowCancelingEdit" OnRowEditing="GridView1_RowEditing" OnRowUpdating="GridView1_RowUpdating" OnRowDeleting="GridView1_RowDeleting" OnPageIndexChanging="GridView1_PageIndexChanging" OnRowDataBound="GridView1_RowDataBound"> <Columns> <asp:TemplateField HeaderText="入库数量"> <ItemTemplate> <asp:Label ID="rukunum" runat="server" Text='<%# Eval("rukunum") %>'></asp:Label> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="Trukunum" Text='<%# Eval("rukunum") %>' runat="server" Font-Size="8" Width="55px" /> </EditItemTemplate> <ItemStyle Width="70px" /> </asp:TemplateField> <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" HeaderText="操作" /> </Columns> </asp:GridView>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询