I am facing an issue while loading the docking window saved XML to load. I have cross-checked XML files and found that there is no error in xml file. But while loading into an application it will show a red color lock icon.
Secondly, additional empty tabs will be shown along with other tabs. I have attached the screeshot. In screenshot, it has fixed window. But red icon can be seen in docking window also.
There are scenarios where empty tabs will be seen in mid of multiple tabs. But data collection don't have additional records.
<Style x:Key="Style.RadTabItem.MainWindow" TargetType="{x:Type telerik:RadTabItem}">
<!-- Base appearance -->
<Setter Property="Background" Value="#01000000" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Padding" Value="16,0" />
<Setter Property="Margin" Value="0,0,0,0" />
<Setter Property="MinWidth" Value="160" />
<Setter Property="MaxWidth" Value="240" />
<Setter Property="IsTabStop" Value="True" />
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="telerikHelpers:ThemeHelper.MouseOverBrush" Value="{DynamicResource Tab.Background.MouseOver}" />
<Setter Property="telerikHelpers:ThemeHelper.CheckedBrush" Value="{DynamicResource Tab.Background.Selected}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type telerik:RadTabItem}">
<Border x:Name="OuterBorder"
Background="Transparent"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<Grid x:Name="grd_MainTabHeader">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Path x:Name="pth_Left"
Fill="White"
Data="M0,16 A16,16 0 0 0 16,0 L16,16 L0,16 Z"
VerticalAlignment="Bottom"
Visibility="Collapsed" />
<Border x:Name="MainBorder"
Background="{TemplateBinding Background}"
CornerRadius="8,8,0,0"
Grid.Column="1"
HorizontalAlignment="Stretch">
<Grid
x:Name="grd_ContentSite"
Margin="0">
<Rectangle x:Name="FocusVisual"
Opacity="0"
StrokeThickness="1"
Stroke="Black"
StrokeDashArray="1,1" />
<ContentPresenter x:Name="ContentSite"
ContentSource="Header"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Margin="{TemplateBinding Padding}" />
</Grid>
</Border>
<Path x:Name="pth_Right"
Fill="White"
Grid.Column="2"
Data="M8,8 A8,8 0 0 1 0,0 L0,8 L8,8 Z"
VerticalAlignment="Bottom"
Visibility="Collapsed" />
</Grid>
</Border>
<ControlTemplate.Triggers>
<!-- Selected state -->
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="MainBorder" Property="Background" Value="White" />
<Setter TargetName="grd_MainTabHeader" Property="Margin" Value="-8,0,-8,0" />
<Setter TargetName="pth_Left" Property="Visibility" Value="Visible" />
<Setter TargetName="pth_Right" Property="Visibility" Value="Visible" />
</Trigger>
<!-- Mouse over state -->
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True" />
<Condition Property="IsSelected" Value="False" />
</MultiTrigger.Conditions>
<Setter TargetName="MainBorder" Property="Background" Value="#e8eaed" />
<Setter TargetName="MainBorder" Property="CornerRadius" Value="16" />
<Setter TargetName="MainBorder" Property="Margin" Value="8, 0" />
<Setter TargetName="grd_ContentSite" Property="Margin" Value="-8, 0" />
</MultiTrigger>
<!-- Focus state -->
<Trigger Property="IsFocused" Value="True">
<Setter TargetName="FocusVisual" Property="Opacity" Value="1"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="Style.RadTabItem.MainWindow" TargetType="{x:Type telerik:RadTabItem}">
<Setter Property="BorderBrush" Value="{DynamicResource Tab.Border.Selected}" />
<Setter Property="BorderThickness" Value="0,2,0,0" />
<Setter Property="Margin" Value="1,0" />
<Setter Property="telerikHelpers:ThemeHelper.MouseOverBrush" Value="{DynamicResource Tab.Background.MouseOver}" />
<Setter Property="telerikHelpers:ThemeHelper.CheckedBrush" Value="{DynamicResource Tab.Background.Selected}" />
<Style.Triggers>
<Trigger Property="IsSelected" Value="False">
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="Background" Value="#E4E9FA" />
<Setter Property="Margin" Value="1,0" />
</Trigger>
</Style.Triggers>
</Style>
Hello,
I'm trying to remove tab items from RadTabControl where ItemsSource is bound to an ObservableCollection<RadTabItem>. However, when an item is deleted from the collection the tab does not disappear. The desired behavior is for the tab to disappear. What do I need to do to achieve this?
Here's what I have:
xaml declaration:
<telerik:RadTabControl x:Name="radTabControl"
ItemsSource="{ Binding Tabs }"
Padding="0, 0, 0, 0"
Margin="0, 0, 0, 0" >
</telerik:RadTabControl>
Here, I declare Tabs as an observable collection:
public ObservableCollection<RadTabItem> Tabs { get; set; }
Here is where the tab items are deleted:
private void RemoveTab(int dev) { Tabs.Clear(); }
I'm not very familiar with WPF and Telerik in general. Any help would be appreciated.
Thanks.
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>
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.
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?
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>
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.
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.