if no childnodes selected (only rootnode),on page reload the rootnode loses checked status

8 posts, 0 answers
  1. JX
    JX avatar
    7 posts
    Member since:
    Jan 2011

    Posted 03 Mar 2011 Link to this post

    hi, the problem im experiencing is regarding a checkbox enabled radtreeview with options
    TriStateCheckBoxes="true"
    CheckChildNodes="false"

    The  rootnode (if no child nodes are selected) does successfully identify (and save) the checkstatus to the database by using:
    the RadTreeView1.CheckedNodes method
    and when I load the tree, I do in fact load the parent node that is checked, with the checked status

    the problem is that when the tree is reloaded ,whilst it does identify that the parent node has a checked status, it does not physically put a check mark next to it on the client side ,although the node.checked  instruction definitely gets executed for the specific rootnode

    e.g. of problem
    Fruit
       - Strawberrys
       - Apples
    Vegetables
      - Cauliflower
      - Pumpkin
    Other

    If i only select fruit, and not strawberries or apples, (thus only selecting the Fruit checkbox), then when the tree gets saved, and reloaded, the Fruit checkbox is not ticked, even though if you loop through the RadTreeView.CheckedNodes, the Fruit node actually says it does have the checked status, even though the Fruit node does not show the checked status on the front end

    the outcome of the problem is thus that the user checks a rootnode, the tree gets reloaded in the backend, and then even though the tree knows (and the properties say) that the rootnode is checked, it does not show the user that the rootnode is checked

    also in the ReloadTree event i created (listed below), even if i just instruct the (root)node to be checked, in the very next line the checkstate of the node is unchecked.

    Also interesting, if i check a Rootnode which does not have childnodes ("Other" in the example), there is no problem, it saves and when the tree is populated, it loads the checkbox again, so this only happens if there are child nodes


    any help? I have to redo a whole system if i cant get this to work
    was this perhaps fixed in newer versions of radtreeview?

     

    Protected Sub ReloadCreatedRADTree(ByVal tv As RadTreeView, ByVal dt As DataTable)
               
            Dim message As String = ""
            Dim nodeColletion As IList = tv.GetAllNodes
      
            For Each node As RadTreeNode In nodeColletion
                    Dim iLoopDT As Integer
      
                For iLoopDT = 0 To dt.Rows.Count - 1
                    Dim iBranchID As Integer = dt.Rows(iLoopDT)("BranchID")
                    If node.Value = iBranchID Then
                        node.Checked = True
                        If node.Level = 0 Then
                            If node.CheckState = TreeNodeCheckState.Unchecked Then
                                 'even though i just instructed the node to be checked,it still has unchecked status here
                            End If
                        End If
                    End If
                Next iLoopDT
            Next node
        End Sub
  2. Nikolay Tsenkov
    Admin
    Nikolay Tsenkov avatar
    734 posts

    Posted 14 Mar 2011 Link to this post

    Hello JX,

    When using the TriStateCheckBoxes, the CheckChildNodes is automatically considered true.


    Regards,
    Nikolay Tsenkov
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. brian
    brian avatar
    36 posts
    Member since:
    Jul 2010

    Posted 20 Apr 2011 Link to this post

    I think the issue being stated is when you call node.Checked on a parent node, it does not have a checkmark (checked) state in the UI.

    I think this is a bug if CheckChildNodes is assumed true on TriState.

    Note, if I call node.CheckChildNodes(); after calling node.Checked, then it works as we think it should.
  4. Nikolay Tsenkov
    Admin
    Nikolay Tsenkov avatar
    734 posts

    Posted 22 Apr 2011 Link to this post

    Hello brian,

    Could you, please, check using the latest version of RadControls for ASP.NET AJAX (Q1 2011)?


    Regards,
    Nikolay Tsenkov
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  5. brian
    brian avatar
    36 posts
    Member since:
    Jul 2010

    Posted 22 Apr 2011 Link to this post

    I am using latest.
  6. Nikolay Tsenkov
    Admin
    Nikolay Tsenkov avatar
    734 posts

    Posted 22 Apr 2011 Link to this post

    Hello brian,

    This indeed seems like a bug in RadTreeView. I am going to log it for fixing.

    Until we fix it, you can use the client-side node.set_checked(bool) method which successfully checks the node and its children.


    Regards,
    Nikolay Tsenkov
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  7. Ravi
    Ravi avatar
    1 posts
    Member since:
    Jul 2011

    Posted 11 Jul 2011 Link to this post

    Hi Brian,

    I am facing the same issue. If only root node is checked and the page is reloaded, root node gets unchecked.(But as mentioned by the original poster, in the server side, root node's checked status is true.But in the client side it doesn't display as checked)

    Can you provide solution for this?


    Thanks,
    Ravi


  8. Nikolay Tsenkov
    Admin
    Nikolay Tsenkov avatar
    734 posts

    Posted 14 Jul 2011 Link to this post

    Hello Ravi,

    Please, open a support ticket and send us a sample project reproducing the issue.
    We will do our best to resolve it.


    Regards,
    Nikolay Tsenkov
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Back to Top