Hi,
I've been working with the RadTreeListView control. I'm very happy with it.
However, I stumbled upon a problem when trying to implement a new feature.
I want to hide the expander button of the "first layer items" (level 0). Technically, it worked by adding a trigger to the GridViewToggleButtonArrowTemplate:
<DataTrigger
Binding="{Binding RelativeSource={RelativeSource AncestorType=telerik:TreeListViewRow}, Path=Level}"
Value="0">
<Setter Property="Visibility" Value="Hidden" />
</DataTrigger>
BUT, this solution leads to a huge gap between the table border and the content of each cell in the first column.
I tried obvious things like applying paddings or margins with negative values or setting the expander button visibility to collapsed instead of hidden. But all of these approaches did not lead me to a consistent solution with a desirable UI. Either, the expander button of child items would not be visible anymore, or there would be a huge indent between level 0 and 1 items.
What I'm trying to achieve is that the expander in level 0 is kind of "wiped out" -> it shouldn't be displayed and there must be no gap. But the expanders for all child items must stay untouched. Therefore, all of the cell content in column 1 would have to be moved to the left by around 20 Px (I guess it's 20 Px, because this is the width of the GridViewToggleButton inside the TreeListViewRowTemplate).
I assume, it's a change which has to be made deeply inside the template. I just couldn't find where yet. All "obvious" approaches didn't lead me to where I wanna get.
Any help is greatly apprexciated!
Best regards,
Alex
Hi,
Is there a way to change the icon for the rad expander from the circle with a '<' or '>' to an icon and shape that I define?
Thanks
Tony
Hi,
I am using <telerik:RadTreeListView> and the scroll functionality does not work. this is how my code looks like:
<UserControl x:Class="WISN.Windows.Survey.FacilityStaffControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:WISN.Windows.Survey.ViewModels"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<telerik:RadTreeListView x:Name="stufftreeListView" AutoGenerateColumns="False"
AutoExpandItems="True" GroupRenderMode="Flat" CanUserDeleteRows="False"
ItemsSource="{Binding AllStaffByType,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged }">
<telerik:RadTreeListView.ChildTableDefinitions>
<telerik:TreeListViewTableDefinition ItemsSource="{Binding StaffCategories,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></telerik:TreeListViewTableDefinition>
</telerik:RadTreeListView.ChildTableDefinitions>
<telerik:RadTreeListView.Columns>
<telerik:GridViewCheckBoxColumn DataMemberBinding="{Binding IsSelected}" AutoSelectOnEdit="True" EditTriggers="CellClick">
<telerik:EventToCommandBehavior.EventBindings>
<telerik:EventBinding Command="{Binding CustomCommandCommand}" EventName="MouseLeftButtonDown" />
</telerik:EventToCommandBehavior.EventBindings>
</telerik:GridViewCheckBoxColumn>
<telerik:GridViewDataColumn IsReadOnly="True" DataMemberBinding="{Binding Name}" Header="Stuff"></telerik:GridViewDataColumn>
<telerik:GridViewDataColumn DataMemberBinding="{Binding AnnualSalary}" Header="Annual Salary"></telerik:GridViewDataColumn>
</telerik:RadTreeListView.Columns>
</telerik:RadTreeListView>
</UserControl>
I really do not know how to fix it.
Thanks
Hi Support team,
even if animation is disabled, the expander is still showing some sort of animation when Windows 11 theme is applied.
This can be reproduced with Telerik samples.
Is there a way to remove that animation entirely so that the content gets displayed immidiateley ?
François
I've used RadGrid and inside that I have one listview with expander control. It is working fine and Expander also expanding and collapsing fine.
But only one issue I have is, when I expanded the Expander and try to scroll down the RadGrid, Expander collapsing every time, it is not retaining it's previous expand state.
I could overcome this by disabling the Virtualization on RadGrid but in that case RadGrid taking long time to load/render.
Any help would be appreciated.
Thanks,
Hello,
Is it possible to have content display vertically in the RadExpander, and collapse horizontally as seen in the attached image?
We need the arrow buttons to be on the right and the expander to collapse to the left.
Thanks
This question is for Telerik UI for WPF, version R2 2022. Development environment is Windows 10 Pro 64-bit, Visual Studio 2022 64-bit version 17.2.2. WPF application targeting .NET Framework 4.8.
I use many Telerik RadExpanders throughout my application. Rather than style the header of each one individually, I would like to apply a master style to the Application.xaml so it will apply to all of them.
An example of one of my RadExpanders is:
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
<telerik:RadExpander x:Name="radExpGeneral" IsExpanded="True"
telerik:AnimationManager.IsAnimationEnabled="False" telerikControls:StyleManager.Theme="Office_Blue">
<telerik:RadExpander.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Steps"/>
</StackPanel>
</telerik:RadExpander.Header>
</telerik:RadExpander>
I'm attempting to style with the following in my Application.xaml:
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
<Style TargetType="{x:Type telerik:RadExpander}">
<Style.Resources>
<Style TargetType="{x:Type HeaderedContentControl}">
<Style.Resources>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="12"/>
<Setter Property="FontWeight" Value="DemiBold"/>
</Style>
</Style.Resources>
</Style>
</Style.Resources>
</Style>
The idea is that this style first targets all RadExpanders, then targets only the header, then applies the style to the textblocks inside of it. The problem seems to be targeting the header only, not the contents. This style does not work. Can anyone advise how to target just the radexpander headers? Thank you!
Hi Team
We are facing frequent more bottom margin issue in RadTreeView with TreeVirtualizationMode="Hierarchical".
There is two level of grouping like parent, child and grandchild. With Hierarchical mode it is happening frequently. But with Recyling and Standard mode it is not happening but the performace is not good. So it is not helping right now.
Tried to adjuest the padding, margins of TreeViewPanel. Nothing helpped. And the number of grand child count is dynamic so cannot assign Height as well.
Need some suggestion. Thanks in advance!
Eg.
Parent A (Expander)
Child A (Expander)
Grandchild A (Content)
Grandchild B (Content)
-----------------------------
----More Blank Space----
------------------------------
Parent B (Expander)
Code
<telerik:RadTreeView x:Name="SearchResultTreeView"
BorderThickness="0"
PreviewKeyDown="SearchResultTreeView_PreviewKeyDown"
telerik:RadTreeViewItem.Selected="SearchResultTreeView_Selected"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
IsVirtualizing="True"
telerik:TreeViewPanel.TreeVirtualizationMode="Hierarchical"
PreviewMouseLeftButtonDown="SearchResultTreeView_PreviewMouseLeftButtonDown"
Margin="0,-1,-1,0" ItemsSource="{Binding MyDummyCollectionView}"
Background="{x:Null}"
BorderBrush="{x:Null}">
Hi,
I have a list of RadExpander, inside every Radexpander there is a Radgridview. When I expand, expander height grow over the size of window and a scroll bar appears in expander control itself.
I would like that expander doesn't grow over the window and the scroll bar appears in the gridview. I could achieve this behaviour setting maxheight in gridview, but I don't want to limit the height of grid.In first attachment the situation when maxheight is not set, in the second with maxheight set, I would achieve the second situation but without setting maxheight.
Thank you
Luigi
Below it is the xaml as appears in LiveVisualTree: I think that the real one it is too much complex to understand the situation quickly.
Hi all,
I have a RadListBox inside a RadExpander. I can't get the notify of SelectedItem, SelectedValue etc
How can manage the selection in this scenario.
Thank you in advance
Luigi
<DataTemplate x:Key="PanelBarCursorTemplate">
<t:RadExpander t:AnimationManager.IsAnimationEnabled="True">
<t:RadExpander.Header >
<StackPanel Orientation="Horizontal" >
<CheckBox Margin="10 5 5 5" VerticalAlignment="Center" IsChecked="{Binding IsChecked}"/>
<TextBlock Text="{Binding Name}" VerticalAlignment="Center" />
<TextBlock Text="{Binding Internal.PositionX, StringFormat={StaticResource ResourceKey=StringFormatTime}}" VerticalAlignment="Center" Margin="5 0"/>
</StackPanel>
</t:RadExpander.Header>
<t:RadExpander.Content>
<StackPanel Orientation="Vertical" Margin="5 0 0 0" VerticalAlignment="Center">
<t:RadGridView ItemsSource="{Binding Internal.PositionsY}"
AutoGenerateColumns="False"
ShowColumnHeaders="False"
ShowColumnFooters="False"
ShowGroupPanel="False"
ShowScrollPositionIndicator="False"
ShowSearchPanel="False"
IsReadOnly="True">
<t:RadGridView.Columns>
<t:GridViewDataColumn DataMemberBinding="{Binding ParameterName}" Width="50"/>
<t:GridViewDataColumn DataMemberBinding="{Binding ParameterValue}" Width="50"/>
</t:RadGridView.Columns>
</t:RadGridView>
<!--<TextBlock Text="{Binding Internal.PositionY, StringFormat={}{0:F4}}"
Visibility="{Binding PositionYVisibility, Converter={StaticResource BoolToVis}}"/>-->
</StackPanel>
</t:RadExpander.Content>
</t:RadExpander>
</DataTemplate>
<t:RadDocking>
<t:RadDocking.DocumentHost>
<StackPanel>
<t:RadListBox ItemsSource="{Binding TabRisultati.Cursori}"
ItemTemplate="{StaticResource PanelBarCursorTemplate}"
SelectionMode="Single"
SelectedItem="{Binding TabCursori.SelectedCursor}"/>
</StackPanel>
</t:RadDocking.DocumentHost>
</t:RadDocking>