Adding a close button in header of Radpane (Urgent)

3 posts, 0 answers
  1. jusin
    jusin avatar
    3 posts
    Member since:
    Jul 2011

    Posted 21 Jul 2011 Link to this post

    Hello!

    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>

    ---TabHeader.cs----------

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

  2. jusin
    jusin avatar
    3 posts
    Member since:
    Jul 2011

    Posted 22 Jul 2011 Link to this post

    anybody can help... thanks a lot!

    don't know why same code worked fine with  Q1 2011, but met EXCEPTION after updating to Q2 2011 !!
  3. DevCraft banner
  4. jusin
    jusin avatar
    3 posts
    Member since:
    Jul 2011

    Posted 26 Jul 2011 Link to this post

    Solved after I check api documents. Thank you, I will request my firm to buy a license further!
Back to Top