Telerik Forums
UI for WPF Forum
1 answer
15 views
I have a `RadPanelBar` bound to an `ItemsSource`.    I have it set to `SelectionMode` single.  And my view-model ensures that there is always a a selected item. 

But how do I force the Panel Bar to make the selected item always be expanded.   I do not want to allow the user to be allowed to ever collapse it. Is it a property I can set in the ItemContainerStyle? Something else?

At one point I tried binding the RadPanelBarItem.IsExpanded property to its `IsSelected` property.  But that didn't work.



<tk:RadPanelBar x:Name="PanelBar" BorderThickness="0"  
        Padding="0 3 0 0" 
        tk:AnimationManager.IsAnimationEnabled="True"
        SelectedItem="{Binding CurrentAnalysisCategory, Mode=TwoWay}"
        ItemsSource="{Binding AnalysisCategories}"
        VerticalContentAlignment="Stretch"
        VerticalAlignment="Stretch">


 <tk:RadPanelBar.Resources>
 <DataTemplate DataType="{x:Type avm:RoutinesVm}">
 <views:RoutinesPanel />
 </DataTemplate>
 <DataTemplate DataType="{x:Type avm:MeasurementsVm}">
 <views:MeasurementsPanel/>
 </DataTemplate>
<DataTemplate x:Key="ViewTemplate">
<ContentPresenter Content="{Binding}" />
 </DataTemplate>
 </tk:RadPanelBar.Resources>

 <tk:RadPanelBar.ItemTemplate>

<HierarchicalDataTemplate 
                ItemsSource="{Binding Data}"
				    ItemTemplate="{StaticResource ViewTemplate}">
			 <TextBlock Text="{Binding Name}" HorizontalAlignment="Center" VerticalAlignment="Center" />
</HierarchicalDataTemplate>


 </tk:RadPanelBar.ItemTemplate>

 <tk:RadPanelBar.ItemContainerStyle>
 <Style TargetType="{x:Type tk:RadPanelBarItem}">
                <Setter Property="Padding"                  Value="3"/>
                <Setter Property="VerticalAlignment"        Value="Stretch"/>
                <Setter Property="VerticalContentAlignment" Value="Stretch"/>
                <Setter Property="MinHeight"                Value="0"/>
                <Setter Property="BorderThickness"          Value="0"/>
                <Setter Property="MaxHeight"                Value="{Binding ElementName='Root', Path=MaxItemHeight}"/>
                <Setter Property="MaxWidth"                 Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type views:ScanImagePanel}}, Path=ActualWidth}"/>
                <Setter Property="tk:AnimationManager.AnimationSelector" Value="{StaticResource FastAnimator}"/>

            </Style>
 </tk:RadPanelBar.ItemContainerStyle>


 </tk:RadPanelBar>




Dimitar
Telerik team
 answered on 26 Jan 2024
9 answers
373 views
I am facing issue in removing the highlighting effect(yellow color on mouse hover) of RadPaneBar in wpf application.
How to remove mouse hover effect from RadPanebar or any specific styles to be applied to remove highlighting.
Let me know.
Masha
Telerik team
 answered on 20 Sep 2023
1 answer
34 views

Hi,

I have the RadPanelBar in figure:

I would like to draw a border around all the items inside a RadPanelBarItem. If I set border in RadPanelBarItem I get the effect as in figure: only the header is bordered while the inside items are not.
My purpose id to hilight the item not the header, is there any way to achieve this?

Thank you

Luigi

Dinko
Telerik team
 answered on 14 Jul 2023
1 answer
44 views

I cannot see any documentation or examples of how to scroll into a view items in a RadPanelBar. Are you able to provide an example of how to do this?

I've found a way to auto expand an item using <Setter Property="IsExpanded" Value="{Binding IsExpanded}" /> but this can expand an item which is still not visible and needs to be manually scrolled to. The IsSelected is similar but just seems to highlight that item and not scroll into view.

How can I auto scroll an item in the RadPanelBar into view using MVVM? Typically there may be approx 200 items but only 10 can be seen in view at any one time.

Code:


<telerik:RadPanelBar x:Name="radPanelBar1" Grid.Row="1" Width="500"
           HorizontalAlignment="Left" VerticalAlignment="Top"
           ItemTemplate="{StaticResource PanelBarHeaderTemplate}"
           ItemsSource="{Binding PanelBar1Items}"
           ExpandMode="Multiple">
      <telerik:RadPanelBar.ItemContainerStyle>
          <Style TargetType="telerik:RadPanelBarItem" BasedOn="{StaticResource RadPanelBarItemStyle}">
              <Setter Property="IsExpanded" Value="{Binding IsExpanded}" />
          </Style>
      </telerik:RadPanelBar.ItemContainerStyle>
</telerik:RadPanelBar>

 

Martin Ivanov
Telerik team
 answered on 12 Jan 2023
1 answer
103 views

I have a panelbaritem that contains a grid. When the grid is expanded I get the scrollbar as expected. I am able to scroll up/down by dragging the scrollbar button up/down. However, I cannot use the mousewheel to scroll.

Is there any special setting to enable mouse wheel scrolling.

Just to make sure that it is not a problem with my project, I created a small test project and see the same behavior.

Stenly
Telerik team
 answered on 18 May 2022
1 answer
50 views

I would like my PanelBarItem to not change the background color while I move my move over it.

This is what is happening and not desired

This is what is desired

Is there an easy and simple way to accomplish this?

Note: I am okay with the Header area changing color while the mouse is over that area. (area containing text A,B,C.).

I would like to avoid extracting and changing the entire template just for this one small change.

Thanks in advance.

Stenly
Telerik team
 answered on 09 May 2022
1 answer
86 views

Hello,

I have a need to customize the header part of the RadPanelBarItems, by adding a checkbox (see below). When I make this change, the text color used for that particular RadPanelBarItem (in this case "Five") is not the same as the defaults (during mouse over or selection).

How can I get the default behavior of the Black color font when selected (or mouse over) on my customized RadPanelBarItem. The only thing I need to do is add a checkbox to the header as shown.

In the picture below items "One", "Two", "Three" and "Four" use default behavior. "Five" has the customized header.

Thanks in advance

Mouse over or selected "Five". Notice the "White" font does not change to Black.

Mouse over or selected "Two". Notice that the font changes to "Black" - desired behavior

 

   <telerik:RadPanelBar>
            <telerik:RadPanelBarItem Header="One">
            </telerik:RadPanelBarItem>
            <telerik:RadPanelBarItem Header="Two">
            </telerik:RadPanelBarItem>
            <telerik:RadPanelBarItem Header="Three" />
            <telerik:RadPanelBarItem Header="Four" />

            <telerik:RadPanelBarItem>
                <telerik:RadPanelBarItem.Header>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="Five" />
                        <CheckBox Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    </Grid>
                </telerik:RadPanelBarItem.Header>
            </telerik:RadPanelBarItem>
        </telerik:RadPanelBar>
Dilyan Traykov
Telerik team
 answered on 11 Apr 2022
1 answer
118 views

Hi, I have the following code and I want to have an animation to enable and disable any "radpane "in the related "radpanegroup".

For example, when I put a "radpane" in pin mode, its width increases by 3 seconds, or another example is that the border color changes.
My solution is to use: 

<telerik:RadDocking>

        ...

...

...

<telerik:RadDocking.FlyoutBehavior>
                <local:AnimatedFlyoutBehavior/>
            </telerik:RadDocking.FlyoutBehavior>

</telerik:RadDocking>

 

I used the IFlyoutBehavior interface and as a result the following functions were implemented:

  void IFlyoutBehavior.OnMouseEnter (IFlyoutHost host, RadPane targetPane)
        {

        }

        void IFlyoutBehavior.OnPaneActivated (IFlyoutHost host, RadPane targetPane)
{
        }

        void IFlyoutBehavior.OnMouseLeave (IFlyoutHost host)
        {

        }

        void IFlyoutBehavior.OnOpeningTimerTimeout (IFlyoutHost host)
        {


        }

        void IFlyoutBehavior.OnClosingTimerTimeout (IFlyoutHost host)
        {

        }

        void IFlyoutBehavior.OnPaneDeactivated (IFlyoutHost host, RadPane targetPane)
        {
            var selectedPane = host.SelectedPane;

            if (selectedPane! = null &&! selectedPane.IsActive && host.CurrentState == FlyoutState.Opened)
            {
                host.StartCloseAnimation ();
            }
        }

        void IFlyoutBehavior.OnPaneMouseLeftButtonDown (IFlyoutHost host, RadPane targetPane)
        {
            if (host.CurrentState! = FlyoutState.Opened)
            {
                host.StartOpenAnimation ();
            }
            else
            {
                host.StartCloseAnimation ();

            }
        }

    }

I could not use enough of this interface. Is there a better way to customize animation in radpane or to develop it that way?

 

 

                     
Dilyan Traykov
Telerik team
 answered on 15 Dec 2021
3 answers
148 views
            <telerikNavigation:RadPanelBar Orientation="Horizontal" Height="100"  HorizontalAlignment="Stretch">
                <telerikNavigation:RadPanelBarItem Header="Photo" >
                </telerikNavigation:RadPanelBarItem>
                <telerikNavigation:RadPanelBarItem Header="Page">
                    <ctrl:ctrl />
                </telerikNavigation:RadPanelBarItem>
                <telerikNavigation:RadPanelBarItem Header="Cover>
                    <ctrl:ctrl />
                </telerikNavigation:RadPanelBarItem>
            </telerikNavigation:RadPanelBar>

From the code above, if the content inside the "Page" RadPanelBarItem is too long, the scrollbar will appear.
But this scrollbar appear in RadPanelBar but not that particular PanelBarItem itself.
And if you can want to click "Cover" RadPanelBarITem, you got to scroll to the end of the RadPanelBar to see it.

So, is there anyway to make the scrollbar appear inside the RadPanelBarItem itself but not in RadPanelBar.
Besides, the scrollbar located at top, it block the appearance of Header in RadPanelBarItem.
Can make it locate at bottom instead? More make sense.
Vladimir Stoyanov
Telerik team
 answered on 15 Jun 2020
2 answers
97 views

Hello together,

I use a RadPanelBar to display a List of Dates in a range grouped by week (to better understand I added a picture). If I click a day I want to load right beside it a Datatable into a RadGridView based on the date I selected.

I managed to bind the RadPanelBar to my ViewModel:

<telerik:RadPanelBar
    Grid.Column="0"
    x:Name="rpbKWs"
    ExpandMode="Multiple"
    ItemsSource="{Binding WochenAnzeige}"
    SelectedItem="{Binding selTag, Mode=TwoWay}"
    >
    <telerik:RadPanelBar.ItemTemplate>
        <HierarchicalDataTemplate
            ItemsSource="{Binding TageAnzeige}"
            >
            <HierarchicalDataTemplate.ItemTemplate>
                <DataTemplate>
                    <StackPanel>
                        <TextBlock
                            FontWeight="Medium"
                            Text="{Binding Path=Datum, StringFormat={}{0:dd.MM.yyyy}}"
                            />
                        <TextBlock
                            Margin="0 5 0 0"
                            FontSize="{StaticResource Caption}"
                            Text="{Binding Path=Einträge, StringFormat={}Einträge: {0}}"
                            />
                        <TextBlock
                            Margin="0 2 0 0"
                            FontSize="{StaticResource Caption}"
                            Text="{Binding Path=EinträgeImWerk, StringFormat={}davon im Werk: {0}}"
                            />
                        <TextBlock
                            Margin="0 2 0 0"
                            FontSize="{StaticResource Caption}"
                            Text="{Binding Path=EinträgeMontageEingeteilt, StringFormat={}davon in Montage: {0}}"
                            />
                    </StackPanel>
                </DataTemplate>
            </HierarchicalDataTemplate.ItemTemplate>
            <StackPanel>
                <TextBlock
                    FontWeight="Medium"
                    >
                    <TextBlock.Text>
                        <MultiBinding
                            StringFormat="{}KW {0} Jahr {1}"
                            >
                            <Binding
                                Path="KW"
                                />
                            <Binding
                                Path="Jahr"
                                />
                        </MultiBinding>
                    </TextBlock.Text>
                </TextBlock>
                <TextBlock
                    FontSize="{StaticResource Caption}"
                    >
                    <TextBlock.Text>
                        <MultiBinding
                            StringFormat="{}{0:dd.MM.yy} - {1:dd.MM.yy}"
                            >
                            <Binding
                                Path="MinDatum"
                                />
                            <Binding
                                Path="MaxDatum"
                                />
                        </MultiBinding>
                    </TextBlock.Text>
                </TextBlock>
                <TextBlock
                    Margin="0 5 0 0"
                    FontSize="{StaticResource Caption}"
                    Text="{Binding Path=Einträge, StringFormat={}Einträge: {0}}"
                    />
                <TextBlock
                    Margin="0 2 0 0"
                    FontSize="{StaticResource Caption}"
                    Text="{Binding Path=EinträgeImWerk, StringFormat={}davon im Werk: {0}}"
                    />
                <TextBlock
                    Margin="0 2 0 0"
                    FontSize="{StaticResource Caption}"
                    Text="{Binding Path=EinträgeMontageEingeteilt, StringFormat={}davon in Montage: {0}}"
                    />
            </StackPanel>
        </HierarchicalDataTemplate>
    </telerik:RadPanelBar.ItemTemplate>
</telerik:RadPanelBar>

But have problems with the SelectedItem. The days and weeks are different classes, because they contain different properties for example the week contains a List of days.
If I bind the SelectedItem to the 'selTag' and set a selTag in code nothing happens.

If I change the Selection in UI the property is updated, so this part works.
But if I select a week in UI my whole RadPanelBar gets a red border I don't understand where it comes from. Maybe because a week is a different class then a day and cant be updated because of that?

Is there a way to bind the SelectedItem poperty of a hierarchical RadPanelBar for the parent and chield levels seperately? Or some compleetely different solution?

I have uploaded my project here: https://www.dropbox.com/s/dxbaignaf8rxcx7/ReklamationsManagement.zip?dl=0

It will definitely not run because a sql connection and has some things in it I not longer use, but maybe you better understand my classes there.

Greetings

Benedikt

Benedikt
Top achievements
Rank 3
Iron
Iron
Iron
 answered on 08 Oct 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?