Create and show new undpined pane on event (for example click)

1 Answer 75 Views
Docking
Alexander
Top achievements
Rank 1
Iron
Alexander asked on 03 Mar 2023, 04:19 PM
In my programm there is some search area at the bottom of the window. When  my user select the Item in Bottom area It schould displayed on the right side of the window.  How ever i have problem to Set new Pane focused. Or selected or something like this.  In the exmple  new Pane is created collapsed, and the source Pane stays in focus.   You need click on the new Pane to hide privous one and set the new pane focus. Is it posible to make it from code behind?

1 Answer, 1 is accepted

Sort by
0
Stenly
Telerik team
answered on 08 Mar 2023, 01:28 PM

Hello Alexander,

To achieve this requirement, you could set the IsActive property of the newly created RadPane element to True. In the scenario of the sample project, you could set it inside the BeginInvoke method of the Dispatcher.

The following code snippet shows the modified click event handler to include this suggestion:

private void Button_Click(object sender, RoutedEventArgs e)
{
    System.Windows.Controls.Label l = new Label();
    l.Content = "Test content.";
    RadPane pane = new RadPane();
    pane.Content = l;
    pane.Title = "New focused Pane";
    pane.IsPinned = false;
    Right_group.AddItem(pane, Telerik.Windows.Controls.Docking.DockPosition.Right);

    Dispatcher.BeginInvoke(new Action(() => { pane.IsActive = true; }), System.Windows.Threading.DispatcherPriority.Background);
}

With this being said, I have attached the sample project that you have provided, which is modified to include this suggestion.

Regards,
Stenly
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Alexander
Top achievements
Rank 1
Iron
commented on 09 Mar 2023, 09:23 AM

Thank you for your answer. your solution works fine for me.  Can you help me with following prblem:

How can i prevent my active pane (unpinned) from hiding when i swich form my programm to another one?

 

Stenly
Telerik team
commented on 22 Mar 2023, 05:16 PM

I have tried several different approaches, but I was not able to find a solution that would be utilizable in a production application. However, if this functionality is mandatory, you could try implementing a custom Flyout behavior and implement custom logic in one of the methods, in order to achieve it.
Tags
Docking
Asked by
Alexander
Top achievements
Rank 1
Iron
Answers by
Stenly
Telerik team
Share this question
or