Radtreelist problem to extend the nodes

2 posts, 0 answers
  1. Jerome MAILLEY
    Jerome MAILLEY avatar
    21 posts
    Member since:
    Jul 2009

    Posted 20 Apr Link to this post

    Hello,

    I have a radtreelist and I would like to extend a node according to the objects.

    this is the .ascx side code :

    <telerik:RadTreeList ID="WindowDynamicGrid" runat="server" AllowPaging="false" RenderMode="Lightweight"
        Skin="Metro" DataKeyNames="NodeId" ParentDataKeyNames="ParentId" ClientDataKeyNames="Value" Width="800px"
        AllowSorting="false" AllowFilteringByColumn="false" GridLines="None" OnNeedDataSource="WindowGrid_NeedDataSource"
        AutoGenerateColumns="false" AllowMultiRowSelection="false" ExpandCollapseMode="Client">
        <Columns>
            <telerik:TreeListSelectColumn HeaderStyle-Width="20" visible="true" /> 
        </Columns>
        <ClientSettings>
            <ClientEvents OnTreeListCreated="OnTreeListCreated" />
            <Selecting AllowItemSelection="true" />
            <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true" />
        </ClientSettings>
    </telerik:RadTreeList>

    And this is the .ascx.cs side code :

    protected void Page_PreRender(object sender, EventArgs e)
     {
            var expandedOrSelectedItems = controlItems.Cast<HierarchicalComboBoxItem>().Where(i => i.Checked || i.Expanded);
            foreach (var expandedOrSelectedItem in expandedOrSelectedItems)
            {
                var item = WindowDynamicGrid.FindItemByKeyValue("NodeId", expandedOrSelectedItem.NodeId);
                if (item != null)
                {
                    item.Expanded = expandedOrSelectedItem.Expanded;
                    item.Selected = expandedOrSelectedItem.Checked;
                }
           }
    }

    Do you have an idea of my problem ?

    Thank you

    I have a radtreelist and I would like to extend a node according to my objects to the pre_render
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3916 posts

    Posted 24 Apr Link to this post

    Hello,

    I suggest you try expanding the items with the methods the TreeList provides instead of using properties: http://docs.telerik.com/devtools/aspnet-ajax/controls/treelist/items/expand-collapse-items.

    Regards,

    Marin Bratanov
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top