Hello,
I have a problem with WebDataGrid with deleting row. I have a page with several WebDataGrid, all with AutoCRUD = false, BatchUpdating = true and RowDeleting enabled (with del button and undo button).
The user can modify the data on the page and at the end sends all to the server to process it. Maybe is an stupid question, but in the postback, how can I detect deleted rows in the WebDataGrids? If I loop throw the WebDataDrid rows I see all the rows, including the deleted.
This is one of the WebDataGrid:
<ig:WebDataGrid ID="wdgOperaciones" EnableDataViewState ="true" runat="server" ClientIDMode ="Static" AutoGenerateColumns =" false" BackColor ="white" BorderColor ="#336666" BorderStyle="Double" BorderWidth="3px" CellPadding="4" Font-Size="Small" GridLines="Horizontal" Height="275px" Width="700px" HeaderCaptionCssClass ="CustomHeader"> <Columns> <ig:BoundDataField DataFieldName ="OPERACION" Key ="OPERACION" Header-CssClass ="Operacion"> <Header Text ="Operación"></Header> </ig:BoundDataField> </Columns>
<EditorProviders> <ig:DropDownProvider ID ="ComboOperaciones"> <EditorControl DropDownContainerMaxHeight="200px" EnableAnimations="False" EnableDropDownAsChild="False" ClientIDMode="Predictable"></EditorControl> </ig:DropDownProvider> </EditorProviders>
<Behaviors> <ig:RowSelectors RowNumbering="true" HeaderRowSelectorCssClass ="CustomRowSelectorHeader" />
<ig:EditingCore BatchUpdating ="true" AutoCRUD="False" >
<EditingClientEvents RowAdding ="wdgOperaciones_RowAdding" CellValueChanging ="wdgOperaciones_CellValueChanging" /> <Behaviors> <ig:RowDeleting Enabled ="true" ShowDeleteButton ="true" EnableInheritance =" true" ></ig:RowDeleting> <ig:RowAdding AddNewRowCssClass ="CustomNewRow"> <EditModeActions MouseClick="Single" /> <ColumnSettings> <ig:RowAddingColumnSetting ColumnKey ="OPERACION" EditorID ="ComboOperaciones" /> </ColumnSettings> </ig:RowAdding>
<ig:CellEditing> <EditModeActions MouseClick="Single" /> <ColumnSettings> <ig:EditingColumnSetting ColumnKey ="OPERACION" EditorID ="ComboOperaciones" /> </ColumnSettings> </ig:CellEditing>
</Behaviors> </ig:EditingCore> </Behaviors>
</ig:WebDataGrid>
Thanks for your help
Hello ACSA,
You can achieve this behavior by handling the RowDeleted event in the server. Here you can utilize the RowID provided by the RowDeletedEventHandler to identify the specific row that was marked for deletion in the client. A common example would be: Use rowID to delete row from your data source such that when your grid rebinds to your data source on PreRender that row will no longer appear on the client.
Here's a link to our API with more info on the RowDeleted event: http://help.infragistics.com/doc/ASPNET?page=Infragistics4.Web.v15.2~Infragistics.Web.UI.GridControls.WebDataGrid~RowDeleted_EV.html
Hello Sam,
I’ll try to investigate that you've commented, but I have some doubts. As I say, I have the batchUpdating to true because I want the option to undo a deleted row for example, so, I don’t want that the deleted rows disappear on the client (see image attached) With batchUpdating the changes (updated rows, new rows and deleted rows) are not send to the server until the postback and that’s true, in postback I get the updated rows and the new rows, but deleted rows too?
You say I have to delete the row from my data source and rebind the grid, but that is the opposite to batchUpdating ?
Thanks for your help.
Regards.