Replies
Using the code you provided the control goes into an infinite loop when this is excuted. I have attached the whole page below. The code behind only sets WebDataGrid1.DataSoure and WebDataGrid1.DataBind()
Please advise. Thanks in advance.
Using the code you provided the control goes into an infinite loop when this is excuted. I have attached the whole page below. The code behind only sets WebDataGrid1.DataSoure and WebDataGrid1.DataBind()
Please advise. Thanks in advance.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestBed.aspx.cs" Inherits="TTFinancialProjections.TestBed" %>
<%@ Register Assembly="Infragistics35.WebUI.UltraWebCalcManager.v12.2, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
Namespace="Infragistics.WebUI.UltraWebCalcManager" TagPrefix="igcalc" %>
<%@ Register Assembly="Infragistics35.Web.v12.2, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
Namespace="Infragistics.Web.UI" TagPrefix="ig" %>
<%@ Register Assembly="Infragistics35.Web.v12.2, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
Namespace="Infragistics.Web.UI.GridControls" TagPrefix="ig" %>
<!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">
<title>Testbed</title>
<script type="text/javascript">
function WebDataGrid_CellEditing_ExitedEditMode(sender, eventArgs) {
currentrow = eventArgs.getCell().get_row();
var q1 = currentrow.get_cellByColumnKey("Q1").get_value();
var q2 = currentrow.get_cellByColumnKey("Q2").get_value();
var q3 = currentrow.get_cellByColumnKey("Q3").get_value();
var q4 = currentrow.get_cellByColumnKey("Q4").get_value();
currentAmount = q1 + q2 + q3 + q4;
currentrow.get_cellByColumnKey("Total").set_value(currentAmount);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<div>
<ig:WebDataGrid ID="WebDataGrid1" runat="server" AutoGenerateColumns="false" ShowFooter="true">
<Columns>
<ig:BoundDataField DataFieldName="Id" Key="Id" />
<ig:BoundDataField DataFieldName="Name" Key="Name" Header-Text="Item" />
<ig:BoundDataField DataFieldName="Q1" Key="Q1" Header-Text="Q1" />
<ig:BoundDataField DataFieldName="Q2" Key="Q2" Header-Text="Q2" />
<ig:BoundDataField DataFieldName="Q3" Key="Q3" Header-Text="Q3" />
<ig:BoundDataField DataFieldName="Q4" Key="Q4" Header-Text="Q4" />
<ig:UnboundField Key="Total" Header-Text="Total" />
</Columns>
<Behaviors>
<ig:Activation Enabled="true" />
<ig:EditingCore BatchUpdating="true" AutoCRUD="true">
<Behaviors>
<ig:CellEditing Enabled="true" EditModeActions-EnableF2="true" EditModeActions-MouseClick="Single" CellEditingClientEvents-ExitedEditMode="WebDataGrid_CellEditing_ExitedEditMode">
</ig:CellEditing>
</Behaviors>
</ig:EditingCore>
<ig:Selection RowSelectType="Multiple" CellClickAction="Row" Enabled="true" />
<ig:SummaryRow ShowSummariesButtons="false" FormatString="{1}" AnimationType="Linear" />
</Behaviors>
<EditorProviders>
<ig:NumericEditorProvider />
</EditorProviders>
</ig:WebDataGrid>
</div>
</form>
</body>
</html>