Hi Guys,
I have a simple webGrid in which I have placed a 'delete' button in the first column, I need to find some way to delete the row from the grid (via on click event possibly????/), unfortunatley due to my clients strict no javascript policy I'm finding this incredibly difficult.
Help !CheersMarcps. I have tried numerous demo's on this site without success
Marc,
This would be best done through JavaScript - which, in your circumstance, may be an issue.
I would use a column whose Type is "Button" for the delete button, because this makes it easiest to get a reference to grid objects through the event raised. I'd then handle the grid's client-side ClickCellButton event, with code similar to the following (note that I'm going by documentation, since I can't test this at the moment):
function ultraWebGrid1_ClickCellButtonHandler(gridName,cellId){ // Get a reference to the cell that contains the button that was clicked var cell = igtbl_getCellById(cellId); // Ensure that the cell is in the "Delete" column - replace the condition based on the Key of the column if (cell.Column.Key == "Delete") { // Get a reference to the row that contains the cell var row = cell.getRow(); // Delete the row row.deleteRow(); }}
your example is using javascript and not helpful to the person asking the question...
You could place as asp.net postback button in a template column and then delete the row in the postback...did any of the examples cover this?