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

SelectedText is not being populated when using SelectedValue

1 Answer 125 Views
DropDownTree
This is a migrated thread and some comments may be shown as answers.
Tom Bruinsma
Top achievements
Rank 1
Tom Bruinsma asked on 27 May 2015, 05:26 PM

When setting the selected items using SelectedValue the display text is not being updated. If I expand the dropdown I see the checkboxes selected but the displayed text is empty.

If I select a node it will update the displayed text but until then it is empty. Am i missing something?

Version 2015.1.401.40

<telerik:RadDropDownTree 
    runat="server" 
    ID="rddtTo" 
    CheckBoxes="SingleCheck" 
    Width="732px"
    DefaultMessage="Please select" 
    DataFieldID="ID" 
    DataFieldParentID="ParentID"
    DataValueField="ID" 
    DataTextField="NodeName"
    OnDataBound="rddtTo_DataBound">
</telerik:RadDropDownTree>  

Protected Sub rddtTo_DataBound(sender As Object, e As System.EventArgs)
   DirectCast(sender, Telerik.Web.UI.RadDropDownTree).ExpandAllDropDownNodes()
   rddtTo.SelectedValue = hdnSelectedValues.Value
End Sub

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
   If Not Page.IsPostBack Then
      Using p_Db As New mlDB("Messages_Template_List", -1)
         p_Db.SQL = "Messages_Groups_Select"
         rddtTo.DataSource = p_Db.GetDataTable
         rddtTo.DataBind()
      End Using
   End If
End Sub

 

 

1 Answer, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 29 May 2015, 02:39 PM
Hello,

You are correctly setting the RadDropDownTree's SelectedValue property in the NodeDataBound event handler so looking at your code I think the value that you pass to the property could be what is preventing the nodes from being displayed in the entry area.

You can debug the project, put a break point in the rddtTo_DataBound event handler and check the value of "hdnSelectedValues.Value".

Regards,
Ivan Danchev
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
DropDownTree
Asked by
Tom Bruinsma
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
Share this question
or