Telerik Forums
UI for WPF Forum
0 answers
14 views

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

Andreea
Top achievements
Rank 1
Iron
 asked on 16 Jan 2024
1 answer
52 views

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

Dinko
Telerik team
 answered on 24 Aug 2023
1 answer
109 views

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,

Stenly
Telerik team
 updated answer on 02 Mar 2023
1 answer
70 views

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

Martin Ivanov
Telerik team
 answered on 27 Oct 2022
1 answer
496 views

   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!

Martin Ivanov
Telerik team
 answered on 27 Jun 2022
0 answers
96 views

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}">

Uma
Top achievements
Rank 1
 asked on 11 Mar 2022
1 answer
96 views

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.


<Grid x:Uid="Grid_1">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<t:RadDocking x:Name="radDocking1"
                            RetainPaneSizeMode="DockingAndFloating"
                            CanAutoHideAreaExceedScreen="True"
                            Grid.Row="1" Margin="0 0 0 10"                            
                            BorderThickness="0"
CloseButtonPosition="InPane"
                            Padding="0"
  Close="radDocking1_Close"
  PaneStateChange="radDocking1_PaneStateChange">
<t:RadSplitContainer 
MinWidth="310"
MaxWidth="600" t:DockingPanel.InitialSize="260,150"
                    Name="RightContainer" InitialPosition="DockedRight">
<t:RadPaneGroup >
<t:RadPane>
<t:RadPanelBar 
HorizontalContentAlignment="Stretch"
ExpandMode="Multiple" Name="PanelBarCursor"
t:StyleManager.Theme="Office_Blue"
ScrollViewer.VerticalScrollBarVisibility="Visible">
<t:RadPanelBarItem 
VerticalAlignment="Top"
HorizontalContentAlignment="Left"
Header="{DynamicResource CursoriAssociati}">
<StackPanel>
<t:RadListBox ItemsSource="{Binding TabCursori.Cursori}" 
  SelectionMode="Single"
  Loaded="RadListBox_Loaded"
  SelectedItem="{Binding TabCursori.SelectedCursor}">
<t:RadExpander t:AnimationManager.IsAnimationEnabled="false" IsExpanded="{Binding IsExpanded, Mode=TwoWay}">
<t:RadExpander.Content>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<t:RadGridView 
MaxHeight="250"
ItemsSource="{Binding PositionsY}"
CanUserDeleteRows="False"
CanUserInsertRows="False"
RowIndicatorVisibility="Collapsed"
AutoGenerateColumns="False"
ShowColumnHeaders="False"
ShowColumnFooters="False"
ShowGroupPanel="False"
ShowScrollPositionIndicator="False"
ShowSearchPanel="False"
SelectedItem="{Binding 
RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=t:RadDocking},
Path=DataContext.TabCursori.PositionHilight}"
   IsReadOnly="True">
<t:RadGridView.Resources>
<Style TargetType="t:GridViewRow">
<Setter Property="SelectedBackground" Value="Bisque"/>
</Style>
</t:RadGridView.Resources>
<t:RadGridView.Columns>
<t:GridViewDataColumn DataMemberBinding="{Binding ParameterName}" Width="100"/>
<t:GridViewDataColumn DataMemberBinding="{Binding ParameterValue, StringFormat=N1}" Width="80"/>
</t:RadGridView.Columns>
</t:RadGridView>
<!--<TextBlock Text="{Binding Internal.PositionY, StringFormat={}{0:F4}}"
   Visibility="{Binding PositionYVisibility, Converter={StaticResource BoolToVis}}"/>-->
</Grid>
</t:RadExpander.Content>
</t:RadExpander>
</t:RadPanelBarItem >
</t:RadPanelBar>
</t:RadPane>
</t:RadSplitContainer >
</t:RadDocking>
</grid>
Martin Ivanov
Telerik team
 answered on 10 Feb 2022
1 answer
129 views

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>

Martin Ivanov
Telerik team
 answered on 26 Aug 2021
8 answers
436 views

I ran into a small issue while using the expander control in a window without a border. The issue is that when the expand button is clicked the control seems to jump to the expanded state, then jump back to the collapsed state and then play the expand animation. This only occurs with the following window properties:

  • "WindowStyle="None""
  • "AllowsTransparency="True""

My question is this; has anyone come across this and found a good way around? We could probably create another animation and/or control, but it would be great if we can stay as close to the stock standard Telerik controls as possible.

Thanks in advance.

The code below is from the example here but with a removed window border

<Window x:Class="ExpanderSample.MainWindow"
        Title="MainWindow" 
        WindowStyle="None"            
        AllowsTransparency="True"
        SizeToContent="WidthAndHeight"   
        Height="350"
        Width="525">
    <Window.Resources>
        <Style TargetType="telerik:RadExpander">
            <Setter Property="telerik:AnimationManager.AnimationSelector">
                <Setter.Value>
                    <telerik:AnimationSelector>
                        <telerik:ExpanderExpandCollapseAnimation
                            AnimationName="Expand"
                            Direction="In"
                            TargetElementName="Content"
                            SpeedRatio="0.3" />
                        <telerik:ExpanderExpandCollapseAnimation
                            AnimationName="Collapse"
                            Direction="Out"
                            TargetElementName="Content"
                            SpeedRatio="0.3" />
                    </telerik:AnimationSelector>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="150"/>
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
            <RowDefinition Height="20" />
        </Grid.RowDefinitions>
        <telerik:RadExpander
            Header="MyHeader"                             
            Grid.Row="1"
            IsExpanded="False"    
            VerticalContentAlignment="Top"
            HorizontalContentAlignment="Stretch"
            HorizontalAlignment="Stretch" >
            <telerik:RadExpander.Content >
                <Grid Name="ContentGrid" Height="Auto">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="20"/>
                        <RowDefinition Height="20" />
                        <RowDefinition Height="20" />
                        <RowDefinition Height="20" />
                    </Grid.RowDefinitions>
                    <TextBox  Grid.Row="0" >my content</TextBox>
                    <TextBox  Grid.Row="1" >my content</TextBox>
                    <TextBox  Grid.Row="2" >my content</TextBox>
                </Grid>
            </telerik:RadExpander.Content>
        </telerik:RadExpander>
    </Grid>
</Window>

Rob A.
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 03 Feb 2021
7 answers
302 views
Is there any way to change the circle size of the expander control? Or could you provide an example for replacing the template of the expander control? I would like to increase the size of the circle to make it more touch friendly.

Regards,
Peter
Dilyan Traykov
Telerik team
 answered on 29 Aug 2019
Narrow your results
Selected tags
Tags
+? more
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?
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?