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

Set selected text

1 Answer 159 Views
DropDownTree
This is a migrated thread and some comments may be shown as answers.
robert
Top achievements
Rank 1
robert asked on 21 May 2013, 03:25 PM
I have a RadDropDownTree and i want to set the selected value, I do this with the ddtDiagCategorie_OnNodeDataBound, my node is selected in the list when i open it, but th text is not dispay at first time, I tried with DefaultMessage property with no result. I was thinking that the right manner was using the SelectedText or SelectedValue like a normal dropdown, but th property is readonly, how does I have to do this. (The big consequence is after a modify, if the user don't go to selecte the value in the DropDownTree, he save an empty value in the database...)

My code on the event :

protected void ddtDiagCategorie_OnNodeDataBound(object sender, DropDownTreeNodeDataBoundEventArguments e)
        {
            if (BilletCourant != null && BilletCourant.IdCategorie.HasValue)
            {
                if (e.DropDownTreeNode.Value.Equals(BilletCourant.IdCategorie.Value.ToString()))
                {
                    e.DropDownTreeNode.CreateEntry();
                }
            }
 
            //ExpandAllNodes sur ce contrĂ´le
            e.DropDownTreeNode.Expanded = true;
        }

1 Answer, 1 is accepted

Sort by
0
Kate
Telerik team
answered on 23 May 2013, 03:00 PM
Hello Robert,

Please refer to the following help article where you can get more information and an example demonstrating how to set specific nodes to be selected (checked) - How to Create An Entry or Select a Node

Regards,
Kate
Telerik
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
DropDownTree
Asked by
robert
Top achievements
Rank 1
Answers by
Kate
Telerik team
Share this question
or