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

NodeClick and MultipleSelect='true' not firing

6 Answers 109 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Guido Tapia
Top achievements
Rank 1
Guido Tapia asked on 15 Dec 2008, 12:00 AM
Hi,

When a TreeView has MultipleSelect='true' the Control+Click node selections are not being fired.

I think this is a recent bug as this used to work in older versions of the Telerik.Web.UI library (Not sure which version started this bug).

This is very easy to reproduce. Eg:

Thanks

Guido Tapia

<

 

div>

 

 

<telerik:RadScriptManager ID="sm" runat="server" />

 

 

<telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />

 

 

<script runat="server">

 

 

protected void RadTreeView1_NodeClick(object sender, RadTreeNodeEventArgs e)

 

{

lblClicked.Text = e.Node.Text +

" CLICKED";

 

}

 

</script>

 

 

<asp:Label runat="server" ID="lblClicked" />

 

 

<telerik:RadTreeView ID="RadTreeView1" runat="server" Height="400px" Width="300px" EnableDragAndDrop="true"

 

 

Skin="Office2007" OnNodeClick="RadTreeView1_NodeClick" MultipleSelect="true">

 

 

<Nodes>

 

 

<telerik:RadTreeNode Text="Books" Expanded="true">

 

 

<Nodes>

 

 

<telerik:RadTreeNode Text="Arts" />

 

 

<telerik:RadTreeNode Text="Biographies" />

 

 

<telerik:RadTreeNode Text="Children's Books" />

 

 

</Nodes>

 

 

</telerik:RadTreeNode>

 

 

</Nodes>

 

 

</telerik:RadTreeView>

 

 

</div>

 

6 Answers, 1 is accepted

Sort by
0
Guido Tapia
Top achievements
Rank 1
answered on 16 Dec 2008, 08:05 PM
I have posted this as a support ticket (180451) as this is becoming very high priority for me.

Apologies for the duplication.
0
Veselin Vasilev
Telerik team
answered on 17 Dec 2008, 03:09 PM
Hello Guido Tapia,

Actually this is by design. You have enabled MultipleSelect property, so you expect the user to select multiple nodes. If the treeview fires the NodeClick server event on every node click in this case, then the user will not be able to select multiple nodes at once, because after the first click the page will postback.

So, having MultipleSelect set to True clicking on a node while holding the Ctrl or Shift keys will not fire the NodeClick event.

Note that in this case the client-side events do fire: OnClientNodeClicking and OnClientNodeClicked.

Best wishes,
Veselin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Guido Tapia
Top achievements
Rank 1
answered on 17 Dec 2008, 08:40 PM
That does not sound correct for many reasons:

- This did not use to happen at least not in the non-promethious version.
- If I attach a NodeClick event handler to a node I expect to be notified of NodeClicks (as It used to)
- A postback between ctrl clicks would interfere with the UI, however a callback would still make it possible (as it used to)

This is very similar to a multi select list.  If you attach a SelectionChanged listener you expect to be notified of selection changes, no?

I will attach a client side listener and force the callback but I still say that this is a bug.

Thanks

Guido Tapia
0
Manoj
Top achievements
Rank 1
answered on 06 Jan 2009, 11:52 AM
Hi Guido,
    Can you tell me how you did it ?
With Thanks & Regards
Manoj
0
Guido Tapia
Top achievements
Rank 1
answered on 06 Jan 2009, 08:38 PM
Hi Manoj,

I just called 

__doPostBack(sender.get_id(), '

');

In the OnClientNodeClicked method.

In the Page_Load I then just check if sender is the tree.

Guido

 

0
Manoj
Top achievements
Rank 1
answered on 07 Jan 2009, 10:48 AM
Hi Guido,
    Can you attached the code here which we have written in your page . I tried the same but it is not working.

Regards
Manoj
Tags
TreeView
Asked by
Guido Tapia
Top achievements
Rank 1
Answers by
Guido Tapia
Top achievements
Rank 1
Veselin Vasilev
Telerik team
Manoj
Top achievements
Rank 1
Share this question
or