Telerik Forums
UI for WPF Forum
1 answer
18 views

Hi,
We have an issue with tab control and the drop down menu items. Users can create multiple instances of the same tab, that's being displayed fine but when the drop down menu is shown, I can see the names of the tabs, i.e. multiple instances of say "Customer" tab. Now if I select first repeating tab then click on drop down, I can see multiple tabs being highlighted as selected. My question is how can I make those tab items unique so the tab control recognises them as such.

TIA

P.S. please find attached xaml for styling of drop down items
    <Style TargetType="Telerik_Windows_Controls_TabControl:DropDownMenu" x:Key="DropDownMenuStyle">
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="BorderBrush" Value="{StaticResource MainScreen.DropDownMenu.BorderBrush}"/>
        <Setter Property="Background" Value="{StaticResource {x:Static root:TabResources.Tab_Active_Background_Brush}}"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="IconColumnWidth" Value="0"/>
        <Setter Property="MaxHeight" Value="500"/>
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <telerik:RadWrapPanel Orientation="Vertical"/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="ItemContainerStyle">
            <Setter.Value>
                <Style TargetType="Telerik_Windows_Controls_TabControl:DropDownMenuItem">
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="Telerik_Windows_Controls_TabControl:DropDownMenuItem">
                                <ControlTemplate.Triggers>
                                    <Trigger Property="IsChecked" Value="True">
                                        <Setter Property="TextBlock.FontWeight" Value="Bold"/>
                                        <Setter Property="Border.Visibility" Value="Visible"/>
                                    </Trigger>
                                    <Trigger Property="IsMouseOver" Value="True">
                                        <Setter Property="TextBlock.FontWeight" Value="SemiBold"/>
                                    </Trigger>
                                </ControlTemplate.Triggers>
                                <Grid MaxWidth="250" MaxHeight="100"
                                      ScrollViewer.VerticalScrollBarVisibility="Disabled" 
                                      DataContext="{Binding ., Converter={StaticResource String2ComplexObjectConverter}}" 
                                      ScrollViewer.HorizontalScrollBarVisibility="Disabled">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="2"/><!--padding left-->
                                        <ColumnDefinition Width="3"/><!--selected item border-->
                                        <ColumnDefinition/><!--content-->
                                        <ColumnDefinition Width="5"/><!--padding right-->
                                    </Grid.ColumnDefinitions>
                                    <!--Let's try to put something that can be hit detected when mousing over-->
                                    <TextBlock Text="" Grid.ColumnSpan="4" HorizontalAlignment="Stretch"/>
                                    <Border Background="{StaticResource ResourceKey={x:Static root:TabResources.Tab_Selected_Indicator_Brush}}"
                                            Visibility="{Binding RelativeSource={RelativeSource AncestorType=Telerik_Windows_Controls_TabControl:DropDownMenuItem}, Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}" 
                                            Grid.Column="1"/>
                                    <TextBlock Text="{Binding Title}"
                                               Foreground="{StaticResource {x:Static ColourResources.MenubarRibbonText}}"
                                               Margin="3,0"
                                               FontFamily="Segoe UI"
                                               Grid.Column="2"/>
                                </Grid>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Telerik_Windows_Controls_TabControl:DropDownMenu">
                    <Border Background="{TemplateBinding Background}"
                            Margin="{TemplateBinding Padding}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">
                        <ItemsPresenter Margin="2,5,3,10" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

Dinko
Telerik team
 answered on 08 Nov 2023
0 answers
16 views

Hello dear Telerik Forum.

I have a memory leak problem, where opening views add up in memory, because they are still somehow referenced and thus not GCed.

I've implemented Prism and Telerik both in my application. I've also implemented the ScopedRegionNavigationContentLoader,  the RegionManagerAwareBehavior (and everything else required to open views in new tabs) from Brian (Prism) and the RadTabbedWindow in my MainWindow. So when I execute RequestNavigate from the MainWindow I open new Tabs.

Following happens:

When I execute RequestNavigate commands from the MainWindow I successfully open a new tab which then builds the view, existing of multiple subviews. This works correct so far.

Now when I close the RadTabItems the Views still stay in the memory. It seems there are still references in the RegionManager about the once spawned Regions/Views. Those add up when using the application over hours.

 

So my question is:

How do I unload the Region/View in the RegionManager of the MainWindow when I close the tabs?

I'm looking for a clean and global solution, where I dont have to implement code in every class.

 

 

Extra information:

- There is one RegionManager in the MainWindow, which manages all Tabs and so.

- Each Subview gets its own new RegionManager instance.

 

Anastasios
Top achievements
Rank 1
 updated question on 26 Oct 2023
1 answer
29 views

 radTabControl.SelectedItem = radTabItem;     // set tab as the active one
 radTabItem.Content = userControl;  

The code above runs but the contents of the previous RadTabItem remain on srceen.

The tab and visual indicator showing what tab the user is on show but all the contents are those that belong to the previous tab.
Is there a refresh command that I'm missing?

 

Dinko
Telerik team
 answered on 08 Sep 2023
0 answers
51 views

I have the following

For some reason the binding to MyCommand not triggering at all at my view model
Im using MvvmLight RelayCommand if it matters everywhere in my app

P.s 
I tried to change Button to RadButton and the result are the same

<UserControl>
   <Grid>
       <telerik:RadTabControl>
         <telerik:RadTabControl.AdditionalContent>
              <StackPanel Orientation="horizontal"
                                    DataContext="{Binding RelativeSource={RelativeSource FindAncestor, AnsectorType={x:Type UserControl}}, Path=DataContext}">
                      <Button Command="{Binding Path=MyCommand}">
                      </Button>
              </StackPanel>
        </telerik:RadTabControl.AdditionalContent>
       <telerik:RadTabControl.Items>
             <telerik:RadItem>
                  <!-- Here everything works just fine -->
              </telerik:RadItem>
       </telerik:RadTabControl.Items>
    </telerik:RadTabControl>
   </Grid>
</UserControl>


ofir
Top achievements
Rank 1
 asked on 15 Mar 2023
1 answer
43 views

I am using RadTabItem s. One of them has a RadGridView. EnableRowVirtualization on the grid is set to true as it is by default.

When you change to another tab then change back to the tab with this grid, it is very slow. I am testing with about 2,000 rows. I set EnableRowVirtualization to false and loading and clearing the grid is a little slower, but it's quicker to switch back into the tab with the grid.

It seems to me that switching in and out of this tab when row virtualization is enabled, the grid is disposing and reloading the rows. Loading and clearing the grid with virtualization enabled is faster, but changing tabs is significantly slower than when it's disabled.

I have looked through all the attributes of RadGridView and tried setting a few of them with no luck.

I am trying to figure out if there is some setting/attribute for the RadGridView or RadTabItem I can configure to have tabbing as quick and it is when row virtualization is disabled.

Martin Ivanov
Telerik team
 answered on 16 Nov 2022
1 answer
46 views

Hi team,

How can I  change the background of the  tabcontrol header?

And also  I want to set corners  of  header area like image 2.

I have setted  corners  of   content area ,but there is  a outline, look at image 3

 

Thanks in Advance.

 

Vicky
Telerik team
 answered on 24 Aug 2022
1 answer
42 views

Hi everyone,

I want to set the  color of the selected RadTabItem . I setted MaterialAssist.FocusBrush ,but it was not obvious. Can I set  the selected color like radiobutton in RadTabItem ,cover all the area?

 

 

Thank you!

Vicky
Telerik team
 answered on 31 May 2022
1 answer
55 views

I would like to pop-up a RadContextMenu upon right clicking anywhere in the header area of the TabControl (anywhere in the green area).

Attaching the Context menu as shown below pops up the menu everywhere including the body(ie: red area), which is not desired. I only want the menu to popup in the header area (when clicking on the tabitem headers or in the blank area after the tabitems)

     <telerik:RadTabControl     x:Name="radTabCtrl"
                                   Grid.Row="1"
                                   Margin="20,10,5,5"
                                   HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                                   TabStripPlacement="Left" Align="Right"
                                   DataContext="{Binding Itemss}"
                                   ItemsSource="{Binding}"
                                   PreviewTabClosed="PreviewTabClosed">
            <telerik:RadContextMenu.ContextMenu>
                <telerik:RadContextMenu x:Name="tabCtrlContextMenu" Opening="TabCtrlContextMenu_Opening">
                    <telerik:RadMenuItem Header="Add" Click="Menu_Add_Click"/>
                </telerik:RadContextMenu>
            </telerik:RadContextMenu.ContextMenu>

 </telerik:RadTabControl>

 

Your help is much appreciated.

Stenly
Telerik team
 answered on 22 Apr 2022
1 answer
71 views

Hello,

Is there an option I can enable in the RadTabControl like the one shown below for creating new tabs?

If not, is there a easy way to add a custom "+" button to the toolbar area?

Stenly
Telerik team
 answered on 12 Apr 2022
2 answers
136 views

After upgrading to 2021.3, I could not change the accent color from Fluent Theme anymore.

I've checked and noticed that the problem is with the MaterialAssist, that is not using the color set in the AccentColor of the FluentPalette.

My code has always been like this:

FluentPalette.Palette.AccentColor = (Color)dicEntry.Value;

And it has always worked (I have an old version with the older components and it still works), but now I don't know what to do to fix it.

Diego Modolo
Top achievements
Rank 1
Iron
Iron
 answered on 18 Oct 2021
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?