treeview in combo box problem loading selected value

2 posts, 0 answers
  1. Caroline
    Caroline avatar
    21 posts
    Member since:
    May 2009

    Posted 17 Jul 2009 Link to this post

    Hello

    I am loading in a treeview in a combo box for a user editing page...the combox box loads demographics, On first load if you have previously selected demographics i have got the combo to select the previous one you have chosen from the database but comparing the text and using the following

    If

     

    Me.RadComboBox1.Attributes.Item("TreeviewSelectedItem") Is Nothing Then

     

     

    If objuser.DivisionTwo <> 0 Then

     

     

    Me.RadComboBox1.Attributes.Add("TreeviewSelectedItem", objuser.DivisionTwoDesc)

     

     

    ElseIf objuser.DivisionOne <> 0 Then

     

     

    Me.RadComboBox1.Attributes.Add("TreeviewSelectedItem", objuser.DivisionOneDesc)

     

     

    ElseIf objuser.PearsonBusiness <> 0 Then

     

     

    Me.RadComboBox1.Attributes.Add("TreeviewSelectedItem", objuser.PearsonBusinessDesc)

     

     

    Else

     

     

    Me.RadComboBox1.Attributes.Add("TreeviewSelectedItem", "Please select a division")

     

     

    End If

     

     

    End If

    this works and does preload the correct demographic in the combobox, but problem is when you press 'save' again and havent changed the combo box when it goes to save the demos if have this code to get the chosen id

     

     

    Dim NewRadTreeDivisions As Telerik.Web.UI.RadTreeView

     

     

    Dim DivisionValue As Integer

     

     

     

     

    NewRadTreeDivisions = RadComboBox1.Items(0).FindControl(

    "RadTreeView1")

     

     

    If NewRadTreeDivisions.SelectedValue = "" Then

     

     

     

     

    DivisionValue = 0

     

    Else

     

     

     

     

    DivisionValue = NewRadTreeDivisions.SelectedValue

     

    End If

     

     

     

     

     



    but now at this point NewRadTreeDivisions.SelectedValue  does equal "" therefore sets it back to 0.  even though the correct text is shown in the box the value isnt being passed through...how can i get this to keep the id???

    thank you!

     

  2. Yana
    Admin
    Yana avatar
    4993 posts

    Posted 20 Jul 2009 Link to this post

    Hi Caroline,

    The provided code is not enough to replicate the issue, could you please open a support ticket and send us a simple page demonstrating the problem there? Thanks a lot

    Greetings,
    Yana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top