Child nodes not inheriting parent checked value when load on demand

7 posts, 0 answers
  1. Yaron Lavi
    Yaron Lavi avatar
    7 posts
    Member since:
    Apr 2010

    Posted 11 Apr 2010 Link to this post

    Hi,
    I'm using a RadTreeView like this:

    <

     

    telerik:RadTreeView ID="WebTreeFolders"

     

     

    runat="server"

     

     

    Height="100%"

     

     

    CheckBoxes="True"

     

     

    CheckChildNodes="true"

     

     

    PersistLoadOnDemandNodes="false"

     

     

    EnableViewState="false" >

     

     

     

    <WebServiceSettings Path="Export.aspx" Method="GetNodeItems" />

     

     

    </telerik:RadTreeView>

    The treeview loads child node when expanded using a static page method, and eveything works fine but the following scenario:
    1) A node which NOT expanded is checked.
    2) that node is then expanded.
    3) Upon expand, the child nodes are populated using a web service method.
    4) child node appear un-selected, although their parent node is selected.

    How can I overcome this?

     

  2. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 13 Apr 2010 Link to this post

    Hello Yaron Lavi,

    Please check this how-to article:

    Inherit the the Checked state of the parent Node when loading Nodes on demand

    Greetings,
    Veskoni
    the Telerik team

    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 Public Issue Tracking system and vote to affect the priority of the items.
  3. Yaron Lavi
    Yaron Lavi avatar
    7 posts
    Member since:
    Apr 2010

    Posted 13 Apr 2010 Link to this post

    Your solution will only work if the node's ExpandMode in ServerSideCallback, because in this case you have control over the nodes you're creating.

    If the node's expandMode is webService or a shared (static) page method, you are required to return an array to RadTreeNodeData instances, which do not have a 'Checked' property. The nodes created from these RadTreeNodeData will NEVER be cheked, even if their parent node is chekced.

    So basically your suggestion is to ditch the webservice expnad mode and use serversidecallback instead?

    And another issue: my treeview uses 'Office2007' skin with checkboxes. The style of the checkboxes of the nodes created using load-on-demand looks different than the root nodes I've created programatically. I haven't made a specific styling to the nodes, just using them as-is. what coulkd be the cause?
  4. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 13 Apr 2010 Link to this post

    Hi Yaron Lavi,

    I believe that this help topic will help you to add a Checked property to your nodes:

    Setting additional properties to the node in the Web Service 

    You should check the nodes (node.check()) in the OnClientNodeDataBound event depending on the additional property you defined.

    As for the second problem - do you use RadFormDecorator? If so, what happens when you remove it?

    Best wishes,
    Veskoni
    the Telerik team

    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 Public Issue Tracking system and vote to affect the priority of the items.
  5. Yaron Lavi
    Yaron Lavi avatar
    7 posts
    Member since:
    Apr 2010

    Posted 19 Apr 2010 Link to this post

    Yes, I'm using a decorator in this form:

     

     


     

    <

     

    telerik:RadFormDecorator ID="radd2" runat="server" DecoratedControls="All" />

     

    &lt;</FONT></FONT><FONT color=#a31515 size=2><FONT color=#a31515   
    size=2>telerik</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff   
    size=2>:</FONT></FONT><FONT color=#a31515 size=2><FONT color=#a31515   
    size=2>RadFormDecorator</FONT></FONT><FONT size=2</FONT><FONT color=#ff0000   
    size=2><FONT color=#ff0000 size=2>ID</FONT></FONT><FONT color=#0000ff   
    size=2><FONT color=#0000ff size=2>="radd2"</FONT></FONT><FONT size=2>   
    </FONT><FONT color=#ff0000 size=2><FONT color=#ff0000   
    size=2>runat</FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff   
    size=2>="server"</FONT></FONT><FONT size=2</FONT><FONT color=#ff0000   
    size=2><FONT color=#ff0000 size=2>DecoratedControls</FONT></FONT><FONT   
    color=#0000ff size=2><FONT color=#0000ff size=2>="All"</FONT></FONT><FONT   
    size=2</FONT><FONT color=#0000ff size=2><FONT color=#0000ff   
    size=2>/&gt;</FONT></FONT


    Removing it has no impact - child nodes' checkbox is still drawn differently.
  6. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 21 Apr 2010 Link to this post

    Hi Yaron Lavi,

    Please find attached a sample project. It is actually easier than I thought - you just need to inherit the RadTreeNodeData class and add the Checked property to the new class and the tree will render the checkboxes automatically (no need to hook on the OnClientNodeDataBound event). And the look and feel of the child nodes is the same as the parent node.

    Regards,
    Veskoni
    the Telerik team

    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 Public Issue Tracking system and vote to affect the priority of the items.
  7. Oren Halevi
    Oren Halevi avatar
    8 posts
    Member since:
    Jan 2010

    Posted 03 Nov 2010 Link to this post

    This is exactly what I was looking for!!! thank you
Back to Top