Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
125
RowAdding event not firing
posted

I have a WebDataGrid on my page, with EnableAjax set to false and EditingCore on with Rowadding enabled and AutoCRUD set to false. However, I can't seem to get the RowAdding event to fire on the server. Here is my markup:

<ig:WebDataGrid ID="datagridTotal" runat="server" Height="95px" AutoGenerateColumns="False" OnInitializeRow="datagridTotal_InitializeRow" EnableDataViewState="True" OnRowAdding="datagridTotal_RowAdding" DataKeyFields="DCType" EnableAjax="False">
    <Columns>
        <ig:BoundDataField DataFieldName="DCType" Key="DCType" Width="49px">
            <Header Text="Type">
            </Header>
        </ig:BoundDataField>
        <ig:BoundDataField DataFieldName="DCTotal" DataFormatString="{0:C0}" DataType="System.Decimal" Key="DCTotal" Width="100px" CssClass="Right">
            <Header Text="Gifts">
            </Header>
        </ig:BoundDataField>
        <ig:BoundDataField DataFieldName="DCGTotal" Hidden="True" Key="DCGTotal">
            <Header Text="BoundColumn_4">
            </Header>
        </ig:BoundDataField>
        <ig:BoundDataField DataFieldName="DCGift" DataFormatString="{0:N0}" DataType="System.Decimal" Key="DCGift" Width="60px" CssClass="Right">
            <Header Text="Total">
            </Header>
        </ig:BoundDataField>
        <ig:BoundDataField DataFieldName="DCGGift" Hidden="True" Key="DCGGift">
            <Header Text="BoundColumn_2">
            </Header>
        </ig:BoundDataField>
        <ig:BoundDataField DataFieldName="DCMonthly" DataFormatString="{0:C0}" DataType="System.Decimal" Key="DCMonthly" Width="100px" CssClass="Right">
            <Header Text="Monthly">
            </Header>
        </ig:BoundDataField>
        <ig:TemplateDataField Key="DCExp" Width="21px">
            <ItemTemplate>
                <asp:ImageButton ID="btnExpand" runat="server" OnClientClick="popupTotals(); return false;" ImageUrl="~/Images/Expand.png" ToolTip="Expand" />
            </ItemTemplate>
        </ig:TemplateDataField>
        <ig:TemplateDataField Key="DCAddGoal" Width="21px">
            <ItemTemplate>
                <asp:ImageButton ID="btnAddGoal" runat="server" OnClientClick="popupGoal(); return false;" ImageUrl="~/Images/Goal.png" ToolTip="Goals" />
            </ItemTemplate>
        </ig:TemplateDataField>
    </Columns>
    <Behaviors>
        <ig:EditingCore AutoCRUD="False">
            <Behaviors>
                <ig:RowAdding>
                </ig:RowAdding>
            </Behaviors>
        </ig:EditingCore>
        <ig:Selection>
        </ig:Selection>
    </Behaviors>
</ig:WebDataGrid>

In the javascript, I add a row to the grid upon returning from another window where I selected the record I want added to the grid.

function FundUpdateResponse() {
    var chals;
    var res;
    var grid = window.opener.$IG.WebDataGrid.find("GBCampaignResults_MainTab_tmpl0_datagridTotal");

    if (FundUpdateObj.readyState === 4) {
        if (FundUpdateObj.status === 200) {
            var newRecord = new Array(FundUpdateObj.responseText, 0, 0, 0, 0, 0);
            grid.get_rows().add(newRecord);

            window.close();
        } else {
            alert(FundUpdateObj.statusText + "-Adding a fund-");
        }

        delete FundUpdateObj.onreadystatechange;
        FundUpdateObj = null;
    }
}

So my question is, why isn't the RowAdding event firing? The row does show up in the grid. I've even tried turning on batch updating and then doing a commit to the editing core in the script. No dice. Thanks.