We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to focus item inside ContentControl after ActiveWindow changed

Hello Syncfusion Team,

I would need to insert cursor into the TextBox item after changing a selected tab window. Can you advise me how can I do this?
Can you advise me how to do this so that I will be able move cursor by arrows keys inse TextBox?

XAML:
<Window x:Class="WpfApplication9.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:sf="http://schemas.syncfusion.com/wpf"
        Title="MainWindow" Height="350" Width="525">

    <sf:DockingManager x:Name="x_dock" UseDocumentContainer="True" TabGroupEnabled="False" />

</Window>


Code behind:
public MainWindow()
{
    InitializeComponent();
    Populate();
}


private void
Populate()
{

    for (int i = 0; i < 2; i++)
    {
        var newControl = new TextBox() { Text = "Label " + i };
        DockingManager.SetHeader(newControl, "Label " + i);
        DockingManager.SetState(newControl, DockState.Document);

        x_dock.Children.Add(newControl);
    }
}


Regards
Pavel


1 Reply

DR Durga Rajan Syncfusion Team January 10, 2017 11:58 AM UTC

Hi Pavel,

Thank you for contacting Syncfusion Support.

We have analyzed your query and modified the sample that tries to meet your requirement. In this sample, we have changed the Focusable of the TabItem as false and it will allow the TextBox to get focus on SelectionChange. We can change the Focusable property of TabItem by applying Style to the DocumentTabItem. Please download the modified sample from the below location.​​​

Modified Sample: DockingManager_TabItemFocus_Sample

Regards,
Durga S.

Loader.
Up arrow icon