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

Postback not firing on multi select

3 Answers 65 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Hans Roelants
Top achievements
Rank 1
Hans Roelants asked on 13 Jul 2010, 12:28 PM
Hello,

I have a treeview with multipleselect = true and an event attached to the the NodeClick event. This gets fired when a user clicks a node but it doesn't when the user clicks for the second time using CTRL or SHIFT. How can I activate this 'autopostback' on multi-click events?

Many thx for your help

Hans

3 Answers, 1 is accepted

Sort by
0
Nikolay Tsenkov
Telerik team
answered on 15 Jul 2010, 02:04 PM
Hi Hans Roelants,

Could you, please be bit more specific about what exactly is the scenario you need to implement?


Regards,
Nikolay Tsenkov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Hans Roelants
Top achievements
Rank 1
answered on 20 Jul 2010, 04:43 PM

 

 

 

function OnClientNodeChecked(sender, eventArgs) {
           var node = eventArgs.get_node();
           // check parents
           if (node.get_checked()) {
               while (node.get_parent().set_checked != null) {
                   node.get_parent().check();
                   __doPostBack(???, ???); 
                   node = node.get_parent();
               }
           }


I changed my logic a bit to avoid the Multiselect and now I'm using checkboxes in the treeview.
I use the server-side NodeCheck event to call a webservice, which works fine.

I also wanted to implement logic that when you select a child-node, the parent nodes also get checked.
I found a nice code snippet on the forum that achieves this, however it seems that the .check() event does not cause a postback. I wanted to use the __doPostBack function here but can you tell me wich arguments I should use?

Many thx for your help

 

0
Accepted
Nikolay Tsenkov
Telerik team
answered on 23 Jul 2010, 03:29 PM
Hello Hans Roelants,

Well, we have NodeCheck event, firing server-side, which should work just as fine for you.
Triggering postback manually isn't something that we encourage our clients to do.
Also if you are going to perform some actions on the server, then probably you can move the parent checking there, too?

If you still want to check the parent on the client and then to do something separately on the server, then handle the ClientNodeChecking event (check the parent there) and it will happen before the post back for handling NodeCheck on the server.

Hope this is going to help you!


Regards,
Nikolay Tsenkov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
TreeView
Asked by
Hans Roelants
Top achievements
Rank 1
Answers by
Nikolay Tsenkov
Telerik team
Hans Roelants
Top achievements
Rank 1
Share this question
or