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