Richard,
thak you very much for your help - I really appreciate it. We're close to the sulution, I think, ít works fine except a small little problem - the confirm dialog appears on the second click on the button... Here is the grid:
and here is the confirm Dialog when I click the delete icon in the first row (twice):
Here is what I did:
1) In the grid's ItemCreated event, I added a postback trigger to the delete button:
protected void KeyResourcesGrid_ItemCreated(object sender, DataGridItemEventArgs e)
{
if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
{
ImageButton deleteButton = (ImageButton)e.Item.FindControl("DeleteButton");
if ((AJAX.IsEnabled()) && (deleteButton != null))
AJAX.GetScriptManager(base.Page).RegisterPostBackControl(deleteButton);
}
}
2) Then I injected this script in the Page_Init event:
$(function () {
$(".confirmingGrid .DeleteButton").click(function(e) {
e.preventDefault();
$(this).dnnConfirm({
text: "Are you sure you want to delete \"" + $("td:eq(5)", $(this).parents("tr")).text() + "\"?",
yesText: "Yes",
noText: "No",
title: "Confirm",
dialogClass: "dnnFormPopup",
isButton: true
});
});
});
The problem is - as I mentioned - that the confirm message only appears on the second click (also if I click some other delete buttons between the first and the second click).
Any idea?
Best wishes
Michael