Hi,
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:
cs:
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>
cs:
private void tab1_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
RadTabItem
t = new RadTabItem();
t = rashi.SelectedItem
as RadTabItem;
TextBox tx = new TextBox();
tx = t.Header
as TextBox;
tx.Focus();
tx.SelectAll();
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?
Thanks