根据在另一个gridview文本框中输入的值更新ASP Datagrid行文本框

时间:2017-11-13 22:30:15

标签: javascript c# asp.net gridview

我在下面的ASP Gridview中有两个文本框模板字段 我想使用文本框A的onkeyup事件来根据在文本框A中输入的值更改文本框B中的值

<asp:GridView ID="dgw" runat="server" CssClass="table table-striped table-bordered table-hover table-responsive table-condensed" AutoGenerateColumns="False">
<Columns>
    <asp:TemplateField HeaderText="ID">
        <HeaderTemplate >
            <asp:CheckBox ID="chkboxSelectAll" runat="server" onclick="checkAll(this);" />
        </HeaderTemplate>
        <ItemTemplate >
            <asp:CheckBox ID="LinkButtonEdit" runat="server" CommandName="viewinvoice" CssClass="btn btn-default btn-xs btn-block"
                CommandArgument='<%#Eval("ID")%>'></asp:CheckBox>
        </ItemTemplate>
        <HeaderStyle HorizontalAlign="Center" />
        <ItemStyle HorizontalAlign="Center" />
    </asp:TemplateField>
    <asp:BoundField DataField="D_NAME" HeaderText="District" />
    <asp:BoundField DataField="R_MANAGER" HeaderText="Regional Manager" />
    <asp:BoundField DataField="DISTRICTMANAGER" HeaderText="District Manager" />
    <asp:BoundField DataField="PHONENUMBER" HeaderText="District Manager #." />
    <asp:BoundField DataField="TOTAL" HeaderText="Total"  DataFormatString="{0:n2}"/>
    <asp:TemplateField HeaderText="Qty of Bags" SortExpression="">
        <ItemTemplate>
            <asp:TextBox ID="txtqty" runat="server" data-style="btn-inverse" Text='<%# Bind("QTY") %>' CssClass="form-control" onkeypress="return isNumberKey(event,this)" >
            </asp:TextBox>
        </ItemTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="Amount" SortExpression="">
        <ItemTemplate>
            <asp:TextBox ID="txtamt" runat="server" data-style="btn-inverse" Text='<%# Bind("AMOUNT") %>' CssClass="form-control" onkeypress="return isNumberKey(event,this)" >
            </asp:TextBox>
        </ItemTemplate>
    </asp:TemplateField>
    <asp:BoundField DataField="D_ID" HeaderText="" />
    <asp:BoundField DataField="RMID" HeaderText="" />
    <asp:BoundField DataField="D_MANAGERID" HeaderText="" />
    <asp:BoundField DataField="LASTDATE" HeaderText="Last disbursed" />
    <asp:BoundField DataField="PPK" HeaderText="" />
</Columns>
<HeaderStyle HorizontalAlign="Right" Wrap="True" />

0 个答案:

没有答案