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

Radtreeview in Radcombobox

1 Answer 70 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Djb
Top achievements
Rank 1
Djb asked on 29 Feb 2012, 01:36 AM
Hi,

I am trying to solve a very simple thing but somehow not able to get it working. 

I have a RadComboBox and radtreeview as one of its items. Now, I want to enable user to select only the leaf node. I have marked "Postback" attribute to false if the node is not leaf. so it solves the purpose of firing an event. 

Now , what is happening is, when user clicks parent node, it expands the node but then disappears. so user again have to click the combo box to select. 

Is there anyway i can disable the disappearing of radtreeview in combo box ? 

I have attached some screenshot and my code. I want my dropdown list to look like Pic-2 when i click the parent node. Currently it looks like Pic-1 after i click the parent node. 

Code : OnClientNodeClicking

 var node = eventArgs.get_node();
    if (node.get_level() != 2) {
        node.expand();
return; }

Please help.

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 01 Mar 2012, 06:55 PM
Hello Djb,

 
I have added a similar code to the one that you posted to the code of our RadTreeView in RadCombobox demo and it worked as expected. Here you can see a video of the test:

function nodeClicking(sender, args) {
           var node = args.get_node();
        
           if (node.get_level() != 2) {
               node.expand();
               return;
           }
 
           var comboBox = $find("<%= RadComboBox1.ClientID %>");
 
           var node = args.get_node()
 
           comboBox.set_text(node.get_text());


If the behavior you want to achieve is somehow different please try to explain it once again. 

Greetings,
Plamen Zdravkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
TreeView
Asked by
Djb
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or