AspxGridView客户端多列汇总勾选的数据

2 篇文章 0 订阅

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CredentialBusinessReceive.aspx.cs" Inherits="TC_Code_CredentialManager_CredentialBusinessReceive" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v7.2, Version=7.2.5.0, Culture=neutral, PublicKeyToken=9b171c9fd64da1d1" Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v7.2, Version=7.2.5.0, Culture=neutral, PublicKeyToken=9b171c9fd64da1d1"  Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI" TagPrefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <link  href="../../css/Main.css" rel="stylesheet"  type="text/css" />
    <script src="../../js/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
      <script language="javascript"  type="text/javascript">
       function OnGridSelectionChanged()
         {
             gridView.GetSelectedFieldValues('PaidAmt;MonthAmt;CollectAmt',OnGridSelectionComplete);
         }
        
        function OnGridSelectionComplete(values)
        {
               var objTotalPaidAmt=0;
               var objTotalMonthAmt=0;
               var objTotalCollectAmt=0;
               var objTotalPaid=document.getElementById("<%=tbTotalPaidAmt.ClientID%>");
               var objTotalMonth=document.getElementById("<%=tbTotalMonthAmt.ClientID%>");
               var objTotalCollect =document.getElementById("<%=tbTotalCollectAmt.ClientID%>");
              
               for(var i = 0;i< values.length; i ++)
                {
                    if(isNaN(values[i][0])==false && values[i][0]!=null && values[i][0]!="undefined ")
                    {
                      objTotalPaidAmt += parseFloat(values[i][0]);
                    }
                    if(isNaN(values[i][1])==false && values[i][1]!=null && values[i][1]!="undefined ")
                    {
                      objTotalMonthAmt += parseFloat(values[i][1]);
                    }
                    if(isNaN(values[i][2])==false && values[i][2]!=null && values[i][2]!="undefined ")
                    {
                      objTotalCollectAmt += parseFloat(values[i][2]);
                    }
                }
                objTotalPaid.value=objTotalPaidAmt;
                objTotalMonth.value=objTotalMonthAmt;
                objTotalCollect.value=objTotalCollectAmt;
        }
    </script>
</head>
<body scroll="no">
    <form id="form1" runat="server">
        <asp:ScriptManager id="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:UpdatePanel id="UpdatePanel1" runat="server">
             <ContentTemplate>
                   <table cellpadding="0" cellspacing="0" border="0" width="1000">
                            <tr>
                                <td align="right">收款单号:</td>
                                <td><asp:TextBox ID="txtCredentialNo" runat="server" style="width:100px;background-color:#ffffcc"></asp:TextBox></td>
                                <td align="right">收款日期:</td>
                                <td><asp:TextBox ID="txtDate" runat="server" style="width:100px" CssClass="Wdate"  οnclick="WdatePicker()"></asp:TextBox></td>
                                <td align="right">收款人:</td>
                                <td><asp:TextBox ID="txtPayee" runat="server" style="width:100px"></asp:TextBox></td>
                                <td align="right">结算点:</td>
                                <td><asp:DropDownList ID="ddlHub" runat="server" style="width:105px"></asp:DropDownList></td>
                            </tr>
                            <tr>
                                <td align="right">收款类型:</td>
                                <td><asp:DropDownList ID="cmbCredentialType" runat="server" style="width:105px">
                                    </asp:DropDownList></td>
                                <td align="right">结算方式:</td>
                                <td><asp:DropDownList ID="cmbSettleMethod" runat="server" style="width:105px">
                                    </asp:DropDownList>
                                </td>
                                <td align="right">付款方式:</td>
                                <td><asp:DropDownList ID="cmbPaymentMethod" runat="server" style="width:105px">
                                    </asp:DropDownList></td>
                                <td align="right">票据号:</td>
                                <td><asp:TextBox ID="txtBankNoteNo" runat="server" style="width:100px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="6"  style="background-color:#ffffcc;padding:10px 10px 10px 10px">
                                    <table width="800" cellpadding="0" cellspacing="0" border="0">
                                        <tr>
                                            <td align="right">运单号:</td>
                                            <td><asp:TextBox ID="tbShipMentNo" runat="server" style="width:100px"></asp:TextBox></td>
                                            <td align="right">发车日期:</td>
                                            <td><asp:TextBox ID="tbDateBegin" runat="server" style="width:80px" CssClass="Wdate"  οnclick="WdatePicker()"></asp:TextBox></td>
                                            <td align="right">-</td>
                                            <td><asp:TextBox ID="tbDateEnd" runat="server" style="width:80px" CssClass="Wdate"  οnclick="WdatePicker()"></asp:TextBox>
                                                <asp:Button ID="btnQuery" runat="server" Text="查询" OnClick="btnQuery_Click" /></td>
                                        </tr>
                                    </table>
                                    <table width="800" cellpadding="0" cellspacing="0" border="0">
                                   
                                        <tr>
                                            <td colspan="6">
                                                <dxwgv:ASPxGridView
                                                ID="ASPxGridView1"
                                                Width="99%"
                                                ClientInstanceName="gridView"
                                                KeyFieldName="OrderReleaseTC_GID"
                                                runat="server"
                                                CssFilePath="~/App_Themes/Office2003 Blue/{0}/styles.css"
                                                CssPostfix="Office2003_Blue">
                                                <Columns>
                                                     <dxwgv:GridViewCommandColumn ShowSelectCheckbox="true">
                                                     </dxwgv:GridViewCommandColumn>
                                                    
                                                     <dxwgv:GridViewDataTextColumn Caption="始发地" FieldName="RoadPortDept">
                                                     </dxwgv:GridViewDataTextColumn>
                                                    
                                                      <dxwgv:GridViewDataTextColumn Caption="目的地" FieldName="RoadPortDest">
                                                     </dxwgv:GridViewDataTextColumn>
                                                    
                                                      <dxwgv:GridViewDataTextColumn Caption="运单号" FieldName="OrderReleaseNum">
                                                      </dxwgv:GridViewDataTextColumn>
                                                    
                                                      <dxwgv:GridViewDataTextColumn Caption="运单日期" FieldName="OrderDate">
                                                      <PropertiesTextEdit DisplayFormatString="{0:yyyy-MM-dd}"></PropertiesTextEdit>
                                                      </dxwgv:GridViewDataTextColumn>
                                                    
                                                      <dxwgv:GridViewDataTextColumn Caption="发货现结" FieldName="PaidAmt">
                                                      <PropertiesTextEdit DisplayFormatString="{0:N2}"></PropertiesTextEdit>
                                                      </dxwgv:GridViewDataTextColumn>
                                                    
                                                     <dxwgv:GridViewDataTextColumn Caption="发货月结" FieldName="MonthAmt">
                                                     <PropertiesTextEdit DisplayFormatString="{0:N2}"></PropertiesTextEdit>
                                                     </dxwgv:GridViewDataTextColumn>
                                                    
                                                     <dxwgv:GridViewDataTextColumn Caption="到货现结" FieldName="CollectAmt">
                                                     <PropertiesTextEdit DisplayFormatString="{0:N2}"></PropertiesTextEdit>
                                                     </dxwgv:GridViewDataTextColumn>
                                                    
                                                     <dxwgv:GridViewDataTextColumn Caption="到货月结" FieldName="CollectMonthAmt" Visible="false">
                                                     <PropertiesTextEdit DisplayFormatString="{0:N2}"></PropertiesTextEdit>
                                                     </dxwgv:GridViewDataTextColumn>
                                                    
                                                     <dxwgv:GridViewDataTextColumn FieldName="OrderReleaseTC_GID" Visible="false">
                                                     </dxwgv:GridViewDataTextColumn>
                                                </Columns>
                                                <Settings ShowVerticalScrollBar="True" VerticalScrollableHeight="200"/>
                                                <SettingsPager  PageSize="50"></SettingsPager>
                                                    <Images ImageFolder="~/App_Themes/Office2003 Blue/{0}/">
                                                        <CollapsedButton Height="12px" Url="~/App_Themes/Office2003 Blue/GridView/gvCollapsedButton.png" Width="11px" />
                                                        <ExpandedButton Height="12px" Url="~/App_Themes/Office2003 Blue/GridView/gvExpandedButton.png" Width="11px" />
                                                        <DetailCollapsedButton Height="12px" Url="~/App_Themes/Office2003 Blue/GridView/gvCollapsedButton.png" Width="11px" />
                                                        <DetailExpandedButton Height="12px" Url="~/App_Themes/Office2003 Blue/GridView/gvExpandedButton.png" Width="11px" />
                                                    </Images>
                                                    <Styles CssFilePath="~/App_Themes/Office2003 Blue/{0}/styles.css" CssPostfix="Office2003_Blue">
                                                        <Header ImageSpacing="5px" SortingImageSpacing="5px"></Header>
                                                        <LoadingPanel ImageSpacing="10px">
                                                        </LoadingPanel>
                                                    </Styles>
                                                <ClientSideEvents SelectionChanged="function(s, e){OnGridSelectionChanged();}"/>
                                                </dxwgv:ASPxGridView>
                                                发货现结:<asp:TextBox ID="tbTotalPaidAmt" runat="server" style="width:60px;background-color:#ffffcc"></asp:TextBox>
                                                发货月结:<asp:TextBox ID="tbTotalMonthAmt" runat="server" style="width:60px;background-color:#ffffcc"></asp:TextBox>
                                                到货现结: <asp:TextBox ID="tbTotalCollectAmt" runat="server" style="width:60px;background-color:#ffffcc"></asp:TextBox><br />
                                                <asp:CheckBox ID="chkAll" runat="server" Text="全选" AutoPostBack="true" OnCheckedChanged="chkAll_CheckedChanged"/>
                                            </td>
                                        </tr>
                                    </table>
                                   </td>
                                <td style="text-align:center;">
                                    <asp:Button ID="btnRemove" runat="server" Text="<<" OnClick="btnRemove_Click" />
                                    <br />
                                    <asp:Button ID="btnToLeft" runat="server" Text=">>" OnClick="btnToLeft_Click" />
                                </td>
                                <td>
                                    <asp:ListBox ID="ListBox1" runat="server" Width="90%" Height="250px"></asp:ListBox>
                                    <span style="font-weight:bold">金额:</span><asp:Label ID="lbAmount" runat="server" Text="" style="font-weight:bold;color:Blue"></asp:Label>
                                   
                                    </td>
                            </tr>
                            <tr>
                                <td colspan="8" align="center">
                                    <asp:Button ID="btnSave" runat="server" Text="保存" OnClick="btnSave_Click" /></td>
                            </tr>
                        </table>
             </ContentTemplate>
        </asp:UpdatePanel>
    </form>
</body>
</html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值