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
The grid won't necessarily cause a postback for this event. What you really want to do is cancel the event from occuring, by returning "true" from your function. Your code should look something like
return !(confirm("Are you sure"));
Tony
Instead of using a button to delete a row in UltraWebGrid, I am using delete Key, which works very nice and neat for me. However, when I try to implement confirmation for the deletion, it just does not do it. I see popups but no matter cancel/ok it does all the delete.
{
igtbl_cancelPostBack(gridName);
}
<ClientSideEvents BeforeRowDeletedHandler="deleteTradeRow" BeforeRowTemplateOpenHandler="tradeGrid_Be
Jeff,
client-side event handlers should be defined as the function name only. In your case above, I think including parenthesis is what's messing up the event firing. Set ClickCellButtonHandler="CellClick", and then define
function CellClick(gridname,cellid){//insert code here}
the grid will automatically call the CellClick function with the correct parameters (gridname and cellid). Pretty much every WebGrid client-side event is fired with the first parameter being the grid's id and the second parameter will be the id of the contextual object. So in a cell event, the second parameter is the cellid. All parameters are listed in the client-side api docs.
-Tony
Can u supply an example of aspx code that declares or "tells" this event to occur?
I am using a C# code behind page. I have the postback event handler set up. That works and postback occurs until I try to implement this js confirmation function. Now the js runs, but the postback never occurs, even if the user answers OK to the prompt. Here is what I tryed to do on the aspx page to get this to work:
<ClientSideEvents ClickCellButtonHandler="CellClick()"> </ClientSideEvents>
Also, I do not understand how I could place the cellid in the function call, as every row has a different cellid at run time, doesnt it?
Jeff
Great, it worked
Thank you very much
Regards
-Fernando