This is a migrated thread and some comments may be shown as answers.
if no childnodes selected (only rootnode),on page reload the rootnode loses checked status
7 Answers 37 Views
This is a migrated thread and some comments may be shown as answers.
JX
Top achievements
Rank 1
JX asked on 03 Mar 2011, 08:06 AM
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

7 Answers, 1 is accepted

Sort by
0
Nikolay Tsenkov
Telerik team
answered on 14 Mar 2011, 04:19 PM
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!
0
brian
Top achievements
Rank 1
answered on 21 Apr 2011, 01:06 AM
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.
0
Nikolay Tsenkov
Telerik team
answered on 22 Apr 2011, 02:03 PM
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.

0
brian
Top achievements
Rank 1
answered on 22 Apr 2011, 03:30 PM
I am using latest.
0
Nikolay Tsenkov
Telerik team
answered on 22 Apr 2011, 03:55 PM
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.

0
Ravi
Top achievements
Rank 1
answered on 11 Jul 2011, 11:09 AM
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


0
Nikolay Tsenkov
Telerik team
answered on 14 Jul 2011, 08:57 AM
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!

Asked by
JX
Top achievements
Rank 1
Answers by
Nikolay Tsenkov
Telerik team
brian
Top achievements
Rank 1
Ravi
Top achievements
Rank 1
Share this question
or