Hi,
I have an UltraWebGrid with a column "Delete", column type = Infragistics.WebUI.UltraWebGrid.ColumnType.Button. When the user clicks in the button, I delete the row (from DB, so it is server side). I want to add a confirmation message to ask to the user for confirmation before deleting the row. I want to do it in the client-side. I tried using AJAX but I didn't find the way to use it in UltraWebGrid. Also, I tried using the DisplayLayout.ClientSideEvents.CellClickHandler and others properties but I couldn't solve my problem.
(Note: I have the UltraWebGrid inside a WebAsyncRefreshPanel)
Thanks
Regards,Fernando
You can either use the grid's BeforeDeleteRow client-side event which will only fire when a row is being deleted (through a button click or the delete key press), of you should set an explicit click handler for your button - "<button onclick='deleterow(rowid)'>Delete</button>"
-Tony
Tony,
I have several buttons on the grid one being a delete button. How can I distinquish the correct button? Is it the same name as the key?
Thanks in advance.
{
}
</script>
Samuel,
You control the underlying data which the grid is bound to, which means you have the final say over what data gets deleted and what data remains. You can use the DeleteRow event to handle this scenario. Basically, if you remove the row from your backend data, it is permanently deleted. If you chose not to remove the row from your backend data, it will not be deleted - upon re-binding the webgrid to the datasource, the client-side deleted row will remain.
Hope this helps,
Scratch that question- must not have been thinking straight yesterday. This is the sequence I should be using:
1. User presses delete button client-side to delete row - gets prompted to confirm and they say yes. Button click event triggers server-side postback.
2. In server-side delete button click event handler, attempt to delete row succeeds: delete row from grid; attempt fails: do not delete row from grid. In either case send appropriate response back to client.
Any thoughts on how to handle when the server-side deletion attempt fails (all still as grid within webasynch panel)?
I'm thinking of this sequence of events:
1. User presses delete button client-side to delete row - gets prompted to confirm and they say yes. Delete the row client-side to trigger server-side postback.
2. In server-side delete row event handler, attempt to delete row fails.
3. Now back to the client but the row's gone - what do we do?
Basically is there any way to handle this using infragistics technology?