This is a migrated thread and some comments may be shown as answers.

Delete confirmation of datagrid inside RadAjaxLoadingPanel is not working

2 Answers 58 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
mohsin
Top achievements
Rank 1
mohsin asked on 20 Nov 2009, 12:43 PM
Hi,

I am converting <telerik:AjaxLoadingPanel to <telerik:RadAjaxLoadingPanel in all of our DNN modules.
New  <telerik:RadAjaxLoadingPanel is fine.

But i am having a problem, i have few datgrids inside RadAjaxLoadingPanel.
Those grids are working fine except the delete confirmation button is not triggaring the DeleteCommand event,
 but it was working fine inside previous AjaxLoadingPanel.

I have used 2 methods, both were working well but now they are not working.

#1 methos
----------------------------------------------
markup
========
Here is my code inside RadAjaxLoadingPanel inside Datagrid

<asp:TemplateColumn>
<ItemTemplate>
<asp:Button id="btnAutoAddDelete" runat="server" Text="Delete" CommandName="Delete"
 OnClientClick="return confirm('Are you sure you want to delete this item?')"
UseSubmitBehavior="true"></asp:Button>
</ItemTemplate>
</asp:TemplateColumn>


#2 Method
--------------------------------------------
Here, onlclick is set by codebehind

codbehind
 ============
Private Sub DataGrid3_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles Datagrid3.ItemDataBound
            Dim btnAutoAddDelete As Button
            If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
                btnAutoAddDelete = CType(e.Item.Cells(0).FindControl("btnAutoAddDelete"), Button)
                btnAutoAddDelete.Attributes.Add("onclick", "return confirm_delete();")
            End If
 End Sub

markup
=======
Here is my code inside RadAjaxLoadingPanel inside Datagrid

<ItemTemplate>
<asp:Button id="btnAutoAddDelete" runat="server" Text="Delete"
CommandName="Delete" CausesValidation="false"></asp:Button>
</ItemTemplate>
</asp:TemplateColumn>


-------------------------------------------

I can not understand where is the problem!

Is there anyone to help me out?


Thanks for your time
--Mohsin



2 Answers, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 20 Nov 2009, 04:24 PM
Hi mohsin,

Please try modifying the button declaration as below and see if it works:

<asp:Button id="btnAutoAddDelete" runat="server" Text="Delete" CommandName="Delete" 
 OnClientClick="if(!confirm('Are you sure you want to delete this item?')) return false;">
</asp:Button>


Additionally, you can review this help artcile on client confirmation with RadAjax.

Regards,
Iana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
mohsin
Top achievements
Rank 1
answered on 21 Nov 2009, 05:10 AM
Hi Lana,

Great!!!
 It is working inside new RadAjaxLoadingPanel.

Thanks
--Mohsin
Tags
Ajax
Asked by
mohsin
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
mohsin
Top achievements
Rank 1
Share this question
or