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
300
Issues deleting rows with BatchUpdating
posted

Hi

We have recently upgraded to 2012.2 and we're experience a few issues around BatchUpdating.  We are trying to achieve an outcome where the editing of existing rows is done in 'batch' mode, but deleting or adding rows is done immediately. 

I have got the adding of rows working as expected using information from these forums, however none of the deleting code seems to work.

The 1st issue is that when we highlight and delete the first row it creates a blank row above the first row.  This does not occur when deleting any of the other rows.  I have attached a screenshot of this. 

The 2nd issue (also in screenshot) is that deleting a row causes the Summary Total to be lost.

 

Having noted those first two issues, I wouldn't actually care about them if we could get the grid to actually perform the batch update when the user deletes a row, but it is not working.

The javascript function called on the Client RowDeleted is defined thusly (i have left in the various things we have tried and their results).  Incidentally I have also tried using the RowsDeleteing client side event with similar lack of results.

        function wdg_BatchDelete(sender, e) {

            sender.get_behaviors().get_editingCore().commit();  //doesn't work

            //sender.get_behaviors().get_editingCore().get_behaviors().get_rowDeleting().beginUpdate();  //doesn't work

            //__doPostBack('< %= upBody.ClientID %>', '');   //this does what we want it to do but seems a bit heavy handed

        }

Below is the definition of the grid.  It is bound to an SqlDataSource on the page. 

 

<ig:WebDataGrid ID="WebDataGridLabour" runat="server"  Width="710px"

    AutoGenerateColumns="False" DataSourceID="dsLabour" DataKeyFields="FarmAdjustmentID"

    OnInitializeRow=" WebDataGridFlat_InitializeRow" OnPreRender="WebDataGrid_PreRender"

    CssClass="wdgCellLeft">

    <Columns>

....delete for brevity

    </Columns>

    <Behaviors>

        <ig:Activation>

        </ig:Activation>

        <ig:Selection RowSelectType="Single" CellSelectType="None" />

        <ig:EditingCore BatchUpdating="true">

            <EditingClientEvents CellValueChanged="WebDataGridLabour_CellValueChanged" RowDeleted="wdg_BatchDelete" />

            <Behaviors>

                <ig:CellEditing EditCellCssClass="EditingCell">

                    <CellEditingClientEvents ExitedEditMode="WebDataGridLabour_ExitedEditMode"

                        EnteringEditMode="WebDataGridLabour_EnteringEditMode"/>

                    <EditModeActions EnableOnActive="True" MouseClick="Single" />

                </ig:CellEditing>

                <ig:RowAdding EditModeActions-MouseClick="Single">

                    <AddNewRowClientEvents EnteringEditMode="WebDataGridLabour_NewRowEnteringEditMode"

                        ExitedEditMode="WebDataGridLabour_NewRowExitedEditMode" />

                    <EditModeActions MouseClick="Single" EnableOnActive="True" />

                    <ColumnSettings>

                        <ig:RowAddingColumnSetting ColumnKey="PercentFarm" DefaultValueAsString="100" />

                    </ColumnSettings>

                </ig:RowAdding>

                <ig:RowDeleting />

            </Behaviors>

        </ig:EditingCore>

        <ig:SummaryRow EmptyFooterText="" SummariesCssClass="WdgGridFooter">

            <ColumnSummaries>

                <ig:ColumnSummaryInfo ColumnKey="Amount">

                    <Summaries>

                        <ig:Summary SummaryType="Sum" CustomSummaryName="Total" />

                    </Summaries>

                </ig:ColumnSummaryInfo>

            </ColumnSummaries>

            <ColumnSettings>

                <ig:SummaryRowSetting ColumnKey="Amount" ShowSummaryButton="False">

                    <SummarySettings>

                        <ig:SummarySetting CssClass="WdgGridFooter" />

                    </SummarySettings>

                </ig:SummaryRowSetting>

            </ColumnSettings>

        </ig:SummaryRow>

        <ig:RowSelectors>

            <RowSelectorClientEvents RowSelectorClicked="WebDataGrid_RowSelectorClicked" />

        </ig:RowSelectors>

    </Behaviors>

</ig:WebDataGrid>

 

Is there something we are missing or doing wrong?  Do we need to handle anything on the server side?  Any assistance would be much appreciated.

 

Thanks

Marcus