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" />
<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>
<ig:SummaryRowSetting ColumnKey="Amount" ShowSummaryButton="False">
<SummarySettings>
<ig:SummarySetting CssClass="WdgGridFooter" />
</SummarySettings>
</ig:SummaryRowSetting>
</ig:SummaryRow>
<ig:RowSelectors>
<RowSelectorClientEvents RowSelectorClicked="WebDataGrid_RowSelectorClicked" />
</ig:RowSelectors>
</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
Hi Nikolay
I gave up and just used the __doPostBack on the RowDeleted javascript event to immediately post back to the server as couldn't spend anymore time trying to work it out.
Cheers.
Hello Marcus,
I'm just checking if you have any questions regarding the matter.
Hi Marcus,
I tested the grid using your markup and thr Northwind data source but I could not reproduce these issues. I am attaching the sample I created.
Hope this helps.