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

Treeview in Combo trouble

1 Answer 36 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Ed Staffin
Top achievements
Rank 1
Ed Staffin asked on 10 Dec 2008, 10:13 PM
Hi,
I am having a bit of trouble with the RadCombo that uses a treeview. Everything works perfectly except for the first time I try to select something from the tree. On the first attempt to click on a node in a tree I get the text of the first node and all it's childrens' nodes text concatted together as the text in the combo. If I drop down the combo a 2nd or subsequent time and select something it works as advertised. It's only on the first attempt. Below is all my client code.
Any help would be great!

function comboLoad(sender, eventArgs)  
{  
    sender.set_text(sender.get_items().getItem(0).get_value());  
}  
 
function tvCostCenter_NodeClicking(sender, args)  
{  
    var ddl = $find("Master_cntPageBody_ddlCostCenter");  
    var node = args.get_node()  
    ddl.trackChanges();  
    ddl.get_items().getItem(0).set_value(node.get_value());  
    ddl.set_text(node.get_text());  
    ddl.set_value(node.get_value());  
    ddl.commitChanges();  
    ddl.hideDropDown();  
}  
function StopPropagation(e)  
{  
    if(!e)  
        e = window.event;  
    e.cancelBubble = true;  
}  
function OnClientDropDownOpenedHandler(sender, eventArgs)  
{  
    var tree = sender.get_items().getItem(0).findControl("Master_cntPageBody_ddlCostCenter_i0_tvCostCenter");  
    var selectedNode = tree.get_selectedNode();  
    if (selectedNode)  
    {  
        selectedNode.scrollIntoView();  
    }  
}  
 

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 11 Dec 2008, 02:00 PM
Hi Ed,

How do you use StopPropagation function? Could you paste also the definition of the combobox? Thanks

All the best,
Yana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
ComboBox
Asked by
Ed Staffin
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or