Telerik Forums
UI for Silverlight Forum
2 answers
136 views

Hi,

 We've been using a RadTreeView to display a RadGridView as one of its items, recently we updated to the latest Telerik Silverlight controls and there is a major delay in showing the RadGridView (previously it was pretty instant).  

 

<telerik:RadTreeView Name="AlertTree" 
                                     HorizontalAlignment="Left"
                                     Margin="0,0,0,0"
                                     VerticalAlignment="Top"
                                     IsVirtualizing="True"
                                     telerik:TreeViewPanel.IsVirtualizing="True"
                                     telerik:TreeViewPanel.VirtualizationMode="Standard">

The RadGridView only has 100 rows - it loads at normal speeds into the tree when collapsed (i.e. not visible).   The problem occurs when the tree is expanded to display the RadGridView.  The UI appears to freeze and to display the 100 rows with 6 columns takes a minimum of 10 seconds (previously 1 or 2).  The memory also jumps considerably when RadGridView finally becomes visible.

// Create the grid view
RadGridView aGridView= new RadGridView();
aGridView.ItemsSource = new Telerik.Data.DataTable(e.Result);

// Attach the grid view to the Tree 
RadTreeViewItem aItem = new RadTreeViewItem();
aItem .Header = " Header Info";
aItem .Items.Add(aGridView);

 As mentioned before, this was working fine previously.  

Thanks
Oliver

 

Anatoly
Top achievements
Rank 1
Iron
 answered on 03 Dec 2022
5 answers
132 views
Hi,

First I appologise I do not know which control this should belongs, hence I put this in general discussion.

I am looking for a control which can achieve the following:

- Freeze Column Header
- Freeze Column(s)
- Drill down on Column Header
- Drill down on Row

Attached is the example of report I would like to do in Silverlight.

Currently I know there is the Reporting Viewer, however it does not support Freezing on header. So I cannot choose this option.
The closest I found is the TreeVewList and the DataGrid. However both does not support drill on the header.

Please help and let me know any idea how to achieve this if possible.

Many thanks.
Todor
Telerik team
 answered on 03 Jul 2020
1 answer
46 views

Hi all

I have a issue. I need custom checkbox in TreeView as picture. All checkbox in TreeView is at LEFT. Please help me 

 

Martin Ivanov
Telerik team
 answered on 24 May 2018
3 answers
87 views

I have a scenario where I have a few RadTreeViews inside a Scrollviewer in Silverlight.  When I use a RadTreeView with IsVirtualizing set to false, The mouse Wheel event is bubbled up to the parent control when the RadTreeView gets to the top or bottom of its tree.  When I set IsVirtualizing to True, the mouse wheel event bubbles up when I get to the bottom of the tree but not at the top of the tree.  Is there a way to get the event to be routed when it gets to the top of the list?

I have a sample project but it seems I'm unable to attach it here.

Martin
Telerik team
 answered on 10 May 2018
1 answer
22 views

I have a problem with RadTreeView control. I have a collection like this:

foo

..|-bar

..|-amazing

....|-bar

Element 'bar' have two parents: 'foo' and 'amazing'. When I put collection like this to RadTreeView control and click first 'bar' it select it's every occurrence in control. I need to know exact path of selected element (is it from 'foo' or from 'amazing') and I can't create new elements based on that collection (to be unique) - it have to be this collection. I can only add some new properties in elements.

Dinko | Tech Support Engineer
Telerik team
 answered on 07 Mar 2017
4 answers
166 views
Hi folks,
I have the following problem:
I have hundreds of entries in my TreeView that's why it scrolls. If I select a scrolled item, the tree jumps back to the top and does not stay on the current node position. The selection is still targeting the correct node.

If I just expand the node, the view does scroll to the top.

Update
If i would set a height property, the tree does not jump.

Do you have any idea?

Thanks a lot!

- Tobi
Martin Ivanov
Telerik team
 answered on 22 Feb 2017
5 answers
1.1K+ views
I need to programmatically select an item in the tree view and expand it.  I can select it by setting the SelectedItem = (some object in my collection on my viewmodel).  How can I expand the SelectedItem?  I assume I need to get to the RadTreeViewItem.IsExpanded for the SelectedItem, but how do I get to the RadTreeViewItem that is selected?
Martin Ivanov
Telerik team
 answered on 14 Dec 2016
5 answers
94 views

Dear All,

I started using radtreeview to develop a treeview for first trial.

I am facing a problem with the dragdrop manager, which I belevie with the HierarchicalDataTemplate of my treeview.

The HierarchicalDataTemplate contain a self-reference parent-to-child on the same table as follows:

<telerik:HierarchicalDataTemplate x:Key="ListTemplate"
ItemsSource="{Binding Path=Children, Mode=TwoWay}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock x:Name="Label" Text="{Binding name}" Grid.Column="1" VerticalAlignment="Center"/>
<StackPanel Orientation="Horizontal" Grid.Column="2" VerticalAlignment="Center">
<TextBlock Text=" (" />
<TextBlock Text="{Binding order}" FontSize="10"/>
<TextBlock Text=")"/>
</StackPanel>
</Grid>
</telerik:HierarchicalDataTemplate>

<telerik:HierarchicalDataTemplate x:Key="BigSiteTemplate"
ItemsSource="{Binding Path=GroupList, Mode=TwoWay}"
ItemTemplate="{StaticResource ListTemplate}">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock Text="{Binding Title}" Foreground="Blue" FontWeight="Bold" FontSize="10"/>
</StackPanel>
</telerik:HierarchicalDataTemplate>

 

and my treeview is binded to an observable collection of <User> as follows:

<telerik:RadTreeView x:Name="TOU" FontSize="10" Grid.Row="1"
IsLineEnabled ="True" IsTextSearchEnabled="True" IsEditable="True" IsVirtualizing="True"

ItemTemplate="{StaticResource BigSiteTemplate}"
SelectedItem="{Binding ItemSelected,Mode=TwoWay}"
IsDragDropEnabled="True"
ItemsSource="{Binding Items,Mode=TwoWay}"
>
</telerik:RadTreeView>

 

this observable collection is fully populated with the items from the database with no problem.

Everything is worinking except for the drag&drop which is only can be done at the first level not on the children

let me show you the code I have to populate the Items (tree datasource), because I have done something extra.

IEnumerable<User> g = await DataService.GetUserGroupsAsync(1);
var t = new ObservableCollection<User>();
foreach (User entity in g)
{
t.Add(entity);
}
   tems = new ObservableCollection<GroupLists>();
GroupLists newList = new GroupLists() { Id = "0", Title = "Root", IsExpanded = true };
   Items.Add(newList);

Items[0].GroupList = t; 

Here I am wrapping the GroupList inside a class to add a root level for my displayed items...

 

does anyone has an explanation for that ....

 

Dinko | Tech Support Engineer
Telerik team
 answered on 22 Nov 2016
3 answers
175 views
I want to filter the items displayed in a RadTreeView based on the value of a property set on each item.  I'd like to have the tree view reflect the current state of its items whenever this property is changed.  Is this possible?

This is what I've tried so far but I don't know enough about how QueryableCollectionView and FilterDescriptors work to know that I'm using it properly.
public class Node
{
    public string Name { get; set; }
    public bool IsVisible { get; set; }
    public Node(string name, bool isVisible)
    {
        this.Name = name;
        this.IsVisible = isVisible;
    }
}

ObservableCollection<Node> nodes = new ObservableCollection<Node>();
QueryableCollectionView items = new QueryableCollectionView(nodes);
items.FilterDescriptors.Add(
     new FilterDescriptor(
         "IsVisible", FilterOperator.IsEqualTo, true, false, typeof(bool)
      )
);
Dinko | Tech Support Engineer
Telerik team
 answered on 21 Sep 2016
0 answers
45 views

Search ViewModel change binded ItemsSource [ViewModel.Items = new ObservableCollection <DataItemViewModel> ();] and replaces it with a hierarchical result every time a user changes the query string in the TextBox.

When Virtualizing is "on" and there is a custom RadTreeViewItemStyle (+ IsExpanded on all hierarchy items)

<t:RadTreeView.Resources>
    <Style TargetType="t:RadTreeViewItem" x:Key="DefaultTreeViewItemStyle">
        <Setter Property="FontWeight" Value="Normal" />
        <Setter Property="FontStyle" Value="Normal" />
 
        <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
        <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
    </Style>
    <Style TargetType="t:RadTreeViewItem" BasedOn="{StaticResource DefaultTreeViewItemStyle}" />
</t:RadTreeView.Resources>

Exception: InvalidOperationException
Message : A VirtualizingPanel is not nested in an ItemsControl. VirtualizingPanel must be nested in ItemsControl to get and show items.

But I can solve it by using custom ItemContainerStyleSelector with

private static Style CloneStyle(Style sourceStyle)
{
    if (sourceStyle == null)
        return null;
 
    var clonnedStyle = new Style(sourceStyle.TargetType)
    {
        BasedOn = sourceStyle.BasedOn
    };
 
    foreach (var setterBase in sourceStyle.Setters)
    {
        var setter = setterBase as Setter;
 
        if (setter == null)
            continue;
 
        clonnedStyle.Setters.Add(new Setter
        {
            Property = setter.Property,
            Value = setter.Value
        });
    }
 
    return clonnedStyle;
}

 

Microsoft Silverlight (64-bit) Version: 5.1.41105.0

Windows 8.1 (64-bit)

Internet Explorer 11.0.9600.17416

Telerik 2016.2.503.1050

 

Art
Top achievements
Rank 1
 asked on 30 Aug 2016
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?