I added a close button in header of Radpane by creating a usercontrol.This worked fine in the prev versions(2011.1.419.1040),but after I upgrade my sln to telerik q2 2011, exceptions come out everytime when clicking the close button. I am wondering whether it is a bug or Radpane's properties have been changed in q2 2011 release ? Thx in advance!
sample code is like the following.
--TabHeader.xaml
<UserControl x:Class="test.TabHeader"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
d:DesignHeight="22" d:DesignWidth="400">
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" MinWidth="80"/>
<ColumnDefinition Width="20"/>
</Grid.ColumnDefinitions>
<TextBlock x:Name="tbHeader" Grid.Column="0" />
<telerik:RadButton Grid.Column="1" x:Name="btnClose" Width="16" Height="16" Content="x" Background="Transparent" ToolTipService.ToolTip="close"
FontWeight="Medium" BorderThickness="0" Margin="1" Padding="0" VerticalAlignment="Center" HorizontalAlignment="Center" Click="btnClose_Click" />
</Grid>
</UserControl>
namespace test.UserCtrl
{
public partial class TabHeader : UserControl
{
private RadPane currentPane;
public TabHeader(RadPane pane, string header)
{
InitializeComponent();
this.tbHeader.Text = header;
this.currentPane = pane;
}
private void btnClose_Click(object sender, RoutedEventArgs e)
{
ItemCollection items = (this.currentPane.Parent as RadPaneGroup).Items;
this.currentPane.IsHidden = true;
(items[items.Count - 1] as RadPane).IsSelected = true; }
}
}