Hi,
I would like to completely remove a row from a WebDataGrid(v14.1) so it no longer displays in the grid even though the post back has not occurred yet.
Right now the row is just grayed and crossed out and there is a undo button placed over the row.
I want it to disappear completely.
Hello Even Chen,
Please let me know if you need any further assistance with this matter.
You can not remove a row from WebDataGrid completely until it is present in the underlying data source of the grid, respectively until a postback is triggered.
However, what I can suggest as a work around, is to visually remove the deleted rows from the grid. This could be achieved by using the css classes attached to the deleted rows and to the Undo button by default. The css file for WebDataGrid is ig_dataGrid and is located in the ig_res/Default folder(if you are using any style set different form the default one this folder is going to be name after it). In this file you can edit igg_DeletedRow and igg_UndoButton classes. In this classes the display property should be set to none. For example:
.igg_DeletedRow { display:none; color: #9F9F9F; font-style: italic; text-decoration: line-through; } igg_UndoButton { display:none; background-color: #E8E8E8; border:1px solid #D3D3D3; line-height:normal; border:none; color: #444444; cursor: pointer; padding:3px; }
.igg_DeletedRow
{
display:none;
color: #9F9F9F;
font-style: italic;
text-decoration: line-through;
}
igg_UndoButton
background-color: #E8E8E8;
border:1px solid #D3D3D3;
line-height:normal;
border:none;
color: #444444;
cursor: pointer;
padding:3px;
Please note that this will hide the Undo button even when other actions from editing behavior are performed.
I modified my sample project and I am attaching it for your reference.
Hi Vasya ,
Thanks for your suggestion.
With batch updating, all changes – adding, updating, deleting rows are kept on the client and are send to the server on the first triggered postback.
But i don't want to send to the server when i add,update,delete rows.
Any other ways to completely remove a row?
Please feel free to contact me if you have any additional questions regarding this matter.
Thank you for posting in our community.
I assume that you have the Batch Updating feature of the Editing Behavior enabled. What I can suggest for achieving your requirement is disabling the BatchUpdating. In this case when a row is deleted it is not going to be present in the grid.
I made a small sample illustrating my suggestion and I am attaching it for your reference.
Please try removing the BatchUpdating feature and let me know whether this helps you achieve the desired look and feel for the WebDataGrid.
Some further reference about BatchUpdating could be found at:
http://help.infragistics.com/doc/ASPNET/2014.1/CLR4.0/?page=WebDataGrid_Batch_Updating.html
I hope you find this information helpful.