protected void txtInsNum_TextChanged(object sender, EventArgs e)
    {
        TextBox t = (TextBox)sender;

        GridViewRow drv = (GridViewRow)t.NamingContainer;

        int rowIndex = drv.RowIndex;
       

      
    }
 function txtInsNum(txt) {
            var td = txt.parent();
            var InsNumTotal = td.find("input:eq(3)");
            InsNumTotal.val(td.find("input:eq(0)").val() * 1 + td.find("input:eq(1)").val() * 1 + td.find("input:eq(2)").val() * 1); 
InsNumTotal.change(); }

 

  <asp:TemplateField HeaderText="ORDER QTY READY FOR INSPECTION">
    <ItemTemplate>
        <asp:TextBox ID="txtInsNum1" onblur="txtInsNum($(this))"  runat="server" ></asp:TextBox>
         <asp:TextBox ID="txtInsNum2" onblur="txtInsNum($(this))"   runat="server" ></asp:TextBox>
        <asp:TextBox ID="txtInsNum3" onblur="txtInsNum($(this))"   runat="server" ></asp:TextBox>
         <asp:TextBox ID="txtInsNumTotal" AutoPostBack="true" Enabled="false" OnTextChanged="txtInsNum_TextChanged" runat="server" ></asp:TextBox>
    </ItemTemplate>
</asp:TemplateField>

需要注意 txtInsNumTotal 控件的 AutoPostBack="true"   

纯粹记录,以免以后又忘记了

 

 

相关文章:

  • 2022-12-23
  • 2021-12-14
  • 2022-03-03
  • 2022-12-23
  • 2021-07-15
猜你喜欢
  • 2021-11-24
  • 2021-10-23
  • 2022-12-23
  • 2022-02-26
  • 2022-01-06
  • 2022-01-02
  • 2021-07-08
相关资源
相似解决方案