<script type="text/javascript">
function TotalAmtD1() {
var totalAMT = 0;
var dataItems = $find('<%=gvMulti.ClientID%>').get_masterTableView().get_dataItems();
for (var i = 0; i < dataItems.length; i++) {
var AMT = dataItems[i].get_element().cells(2).innerText; //get grid value
if (AMT == " " || AMT =="NaN") {
AMT = dataItems[i].get_cell("AMT").getElementsByTagName("input")[0].value; //if innerText = " " get Textbox value
}
if (AMT == " " || AMT == "NaN") {
AMT = 0 // All fail get 0
}
totalAMT = parseInt(totalAMT) + parseInt(AMT);
}
document.getElementById("<%= E_txtTOTALAMT.ClientID %>").value = totalAMT;
}
</script>
<ILS:ILSRadGrid ID="gvMulti" runat="server" AllowPaging="True" AllowSorting="True"
AutoGenerateColumns="False" GridLines="None" Skin="Office2007" DataMember="dtMain"
Height="400px" PageSize="200" ShowFooter="false" Width="98%" OnItemDataBound="gvMulti_itemDataBound" a
CellSpacing="0" AlwaysShowEditMode="False" DelChekBoxID="M_chkDEL" DelImageBtnID="M_imgDEL">
<ILSCommandItemSettings ShowAddNewRecordButton="true" />
<ILSColumnSettings AutoGenerateRowIndexColumn="true" AutoGenerateDelColumn="false" />
<%--客戶端設定--%>
<%--分頁設定--%>
<FilterMenu EnableImageSprites="False">
</FilterMenu>
<HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
</HeaderContextMenu>
<ClientSettings AllowColumnsReorder="false" ReorderColumnsOnClient="false">
<KeyboardNavigationSettings AllowSubmitOnEnter="false" />
<Selecting AllowRowSelect="True"></Selecting>
<ClientEvents OnRowClick="GridRowClick" />
<%--OnRowDblClick="GridRowClick"--%>
<Scrolling AllowScroll="true" SaveScrollPosition="true" UseStaticHeaders="true" ScrollHeight="80px" />
</ClientSettings>
<MasterTableView CommandItemDisplay="None" EditMode="InPlace" DataMember="dtMain"
TableLayout="Fixed" RetrieveNullAsDBNull="false" Width="100%">
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column">
</EditColumn>
</EditFormSettings>
<CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
</RowIndicatorColumn>
<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
</ExpandCollapseColumn>
<Columns>
<telerik:GridTemplateColumn HeaderText="月份" UniqueName="DATAMONTH"
ItemStyle-Wrap="false" SortExpression="MONTH">
<ItemTemplate>
<%#DataBinder.Eval(Container.DataItem, "DATAMONTH").ToString().Trim() == string.Empty ?
" " : DataBinder.Eval(Container.DataItem, "DATAMONTH").ToString().Trim()%>
</ItemTemplate>
<HeaderStyle Width="70px" HorizontalAlign="Center" />
<ItemStyle Width="70px" HorizontalAlign="Center" />
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="<font color='red'>*</font>預算金額" UniqueName="AMT"
ItemStyle-Wrap="false" SortExpression="AMT">
<EditItemTemplate>
<ILS:ILSTextBox runat="server" ID="M_intAMT" Title="預算金額" ColumnName="AMT"
MaxLength="12" ValidationGroup="vgSave" Text='<%# Bind("AMT") %>' onchange="return TotalAmtD1();"
Width="98%" ValidType="Number" Style="text-align: right">
</ILS:ILSTextBox>
</EditItemTemplate>
<ItemTemplate>
<%#DataBinder.Eval(Container.DataItem, "AMT").ToString().Trim() == string.Empty ?
" " : DataBinder.Eval(Container.DataItem, "AMT").ToString().Trim()%>
</ItemTemplate>
<HeaderStyle Width="70px" HorizontalAlign="Center" />
<ItemStyle Width="70px" HorizontalAlign="Center" />
</telerik:GridTemplateColumn>