There are a bug in treeview,is it right?Select the first parent,but the treeview shows nothing selected!

6 posts, 0 answers
  1. PEIYANG
    PEIYANG avatar
    65 posts
    Member since:
    Jul 2012

    Posted 09 Jul 2012 Link to this post

    For Example,I have a treeview ,it has 2 notes called China And America,China have 2 child notes called Beijing and GuangXi,They are all collapsed,WHen I select  China ,the treeview's checkitems.count=0;but when I expand it and then select China,its count=2.I added the treeview in a combox,and all treeview node has a checkbox,is it the reason affect treeview?
  2. PEIYANG
    PEIYANG avatar
    65 posts
    Member since:
    Jul 2012

    Posted 10 Jul 2012 Link to this post

    This result called lazy load,How can I to reslove it?
  3. DevCraft banner
  4. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 12 Jul 2012 Link to this post

    Hi PEIYANG ,

     The RadTreeView generates its containers - the RadTreeViewitems when they are:
    1) Root Level Items
    2) Non-Root Item but their parent is Expanded
    I guess you use TriState mode of the RadTreeView with setting the IsInTriStateMode = True. If so, when you check a root level Item which has never been expanded, only it will be in the CheckedItems Collection. In other words its children cannot be in the CheckedItems since they are not generated yet.
    Could you please elaborate more on your scenario? It's not a good idea to use the CheckedItems collection because it has some known issues.

    Regards,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  5. PEIYANG
    PEIYANG avatar
    65 posts
    Member since:
    Jul 2012

    Posted 12 Jul 2012 Link to this post

    If I set IsInTriStateMode = false,so it can not be lazy load??
  6. PEIYANG
    PEIYANG avatar
    65 posts
    Member since:
    Jul 2012

    Posted 12 Jul 2012 Link to this post

    what is the meaning of IsInTriStateMode ?
  7. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 17 Jul 2012 Link to this post

    Hello PEIYANG,

    TriStateMode should be used only in static scenarios (RadTreeViewItems are defined in XAML (not via binding)) and means that when a parent not is checked all of its children are checked too. If some of the children are checked and some a unchecked, the parent is in Indeterminate state. If all children are unchecked the parent is unchecked too.
    In databinding scenarios, due to some known limitations in RadTreeView, this property won't work as expected. So we highly suggest you to use the approach described in this help article.

    All the best,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top
DevCraft banner