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
Hi all
I have a issue. I need custom checkbox in TreeView as picture. All checkbox in TreeView is at LEFT. Please help me
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.
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.
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 ....
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
)
)
);
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