Rad alert in drop node handler

2 posts, 0 answers
  1. Joshua
    Joshua avatar
    2 posts
    Member since:
    Dec 2010

    Posted 17 Dec 2010 Link to this post

    I have two treeviews (left and right).  Our client want to prevent a user from dragging certain types of items from left or right, but to avoid confusion on their part, does not want left to have any items suppressed.  I have the check in the drop handler to see if the node should not be able to be dropped, and it works.  The only problem is that I'm trying to show a rad alert when I stop the drop from happening, but I cannot get it to pop:

    <telerik:RadAjaxManagerProxy ID="ajxManager" runat="server">
            <AjaxSettings>
    <telerik:RadAjaxManagerProxy ID="ajxManager" runat="server">
            <AjaxSettings>
    <telerik:RadAjaxManagerProxy ID="ajxManager" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="left">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="left" LoadingPanelID="alpT" />
                        <telerik:AjaxUpdatedControl ControlID="right" LoadingPanelID="alpT" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="right">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="right" LoadingPanelID="alpT" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManagerProxy>
     
     
    ...
     
     
    <telerik:RadTreeView ID="right" BorderColor="Black" BorderWidth="1px" OnClientContextMenuItemClicked="ContextMenuClick"
                        runat="server" OnNodeDrop="HandleDrop" OnNodeEdit="HandleNodeEdit" OnNodeExpand="right_NodeExpand"
                        EnableDragAndDrop="True" EnableDragAndDropBetweenNodes="True" Height="475px"
                        Width="350px" meta:resourcekey="trvResource1">
    ...
    </telerik:RadTreeView>


    Protected Sub HandleDrop(ByVal sender As Object, ByVal e As RadTreeNodeDragDropEventArgs)
    ...
        If ShouldNotDrop Then
            Dim strScript As String = "Sys.Application.add_load(function(sender, args) {if (!args.get_isPartialLoad()){radalert(""You cannot drop this here"");}});"
            Telerik.Web.UI.RadAjaxManager.GetCurrent(Me).ResponseScripts.Add(strScript)
       End If
    ...
    End Sub


    The code does get written to the page, I've verified this with fidler, but for some reason it is not popping up.
  2. Nikolay Tsenkov
    Admin
    Nikolay Tsenkov avatar
    734 posts

    Posted 22 Dec 2010 Link to this post

    Hello Joshua,

    Could you, please, try to follow the example given in this kb article: http://www.telerik.com/support/kb/aspnet-ajax/window/calling-radalert-from-codebehind.aspx


    Regards,
    Nikolay Tsenkov
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top