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

OnClientNodeDragStart and alert

3 Answers 62 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Ben Turpin
Top achievements
Rank 1
Ben Turpin asked on 26 Aug 2008, 03:02 PM
Hi.

Im trying to deny some operation on the client side through the OnClientNodeDragStart treeview event. If I show a simple alert in the handler the node gets stuck.
        function OnDragStart(sender, args) 
        { 
           alert("hello"); 
            
        } 








<body> 
    <form id="form1" runat="server"
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
    </telerik:RadScriptManager> 
    <div> 
        <telerik:RadAjaxManager ID="RadAjaxManager" runat="server"
        </telerik:RadAjaxManager> 
        <telerik:RadTreeView ID="RadTreeView" runat="server"  
            LoadingStatusPosition="BeforeNodeText" EnableDragAndDrop="True"  
            onclientnodedragstart="OnDragStart"
            <Nodes> 
                <telerik:RadTreeNode runat="server" Expanded="True" ExpandMode="ClientSide"  
                    Text="Parent A" Value="a"
                    <Nodes> 
                        <telerik:RadTreeNode runat="server" ExpandMode="ClientSide" Text="Child A.1"  
                            Value="a1"
                        </telerik:RadTreeNode> 
                        <telerik:RadTreeNode runat="server" ExpandMode="ClientSide" Text="Child A.2"  
                            Value="a2"
                        </telerik:RadTreeNode> 
                    </Nodes> 
                </telerik:RadTreeNode> 
            </Nodes> 
<CollapseAnimation Type="OutQuint" Duration="100"></CollapseAnimation> 
 
<ExpandAnimation Type="OutQuart" Duration="100"></ExpandAnimation> 
        </telerik:RadTreeView> 
    </div> 
    </form> 
</body> 
 

Thanks






3 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 26 Aug 2008, 03:10 PM
Hello Ben Turpin,

This is currently not supported. Could you please give us more details about your requirements? Perhaps there is a different way to achieve this task.

Regards,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Ben Turpin
Top achievements
Rank 1
answered on 26 Aug 2008, 05:16 PM
Hi, thanks for the reply.

Well what I want is to dont let the user select nodes from different parents ans show an alert() .
 As a first idea, I used the OnClientClicking event and checked if the new selected node is from the same parent as the other selected nodes. But this approach only works when the user releases the mouste button, in other words, the event OnClientClicking only fires just before the release of the mouse button.
So if I select the all the childs nodes and then at last click and drag the parent node it selects the parent node and drags it because the OnClientClicking has not been fired.

Any other option?

Thanks!


0
Veselin Vasilev
Telerik team
answered on 29 Aug 2008, 12:04 PM
Hello Ben Turpin,

You can still hook on the OnClientNodeDragStart client-side event, but just do not alert. You can have a label below the treeview and mark its text in red if the operation is not supported.

Please find attached a sample page.


Sincerely yours,
Veskoni
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
TreeView
Asked by
Ben Turpin
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Ben Turpin
Top achievements
Rank 1
Veselin Vasilev
Telerik team
Share this question
or