Rename Tab Item header

2 posts, 0 answers
  1. runes
    runes avatar
    15 posts
    Member since:
    Mar 2009

    Posted 05 Apr 2009 Link to this post

    I'd like to create a tab control in which the header is editable - the user will be able to change the header (like in Exel).
    I tried to do it, but it was not work:
    I define tab item with header (Header="My Tab" ),on double-click the headre content replaced with a TextBox.(Then give focus to the textBox and SelectAll()...)
    but the text box value was always null.
    When I put initially TextBox in the header, it was work!
    my code:



    <telerikNavigation:RadTabControl x:Name="rashi" AllowDragReorder="True" AllowDragOverTab="True" >




    <telerikNavigation:RadTabItem x:Name="tab1" Header="My Tab" MouseLeftButtonUp="tab1_MouseLeftButtonUp"></telerikNavigation:RadTabItem>




    private void tab1_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)








    t = new RadTabItem();


    t = rashi.SelectedItem

    as RadTabItem;



    TextBox tx = new TextBox();


    tx = t.Header

    as TextBox;




    tx.Background =

    new SolidColorBrush(Colors.Transparent);


    tx.BorderThickness =

    new Thickness(0);






    Can you help me? Why this does not work? Maybe you have other idea?


  2. Miroslav
    Miroslav avatar
    922 posts

    Posted 07 Apr 2009 Link to this post

    Hello runes,

    There is a thread here where we discuss an implementation of this same thing (using an EditableContentControl):

    Please note that with thee Q1 release we missed out a TemplateBinding so Binding may not work in certain cases. You can find a project with working ControlTemplate here:

    (This will be fixed for the SP)

    Sincerely yours,
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Back to Top