Skip to content

Latest commit

 

History

History
46 lines (39 loc) · 1.36 KB

kb-add-additional-element-inside-radtabbedwindows-header.md

File metadata and controls

46 lines (39 loc) · 1.36 KB
title description type page_title slug position tags ticketid res_type
Add additional element inside RadTabbedWindow's header
This article demonstrates how to add additional element inside RadTabbedWindow's header.
how-to
How to add additional element inside RadTabbedWindow's header
kb-add-additional-element-inside-radtabbedwindows-header
0
tabbedwindow, element, header
1444813
kb

Environment

Product Version 2019.3.1023
Product RadTabbedWindow for WPF

Description

How to add additional element inside RadTabbedWindow's header.

Solution

To achieve this requirement, you can subscribe to the Loaded event of RadTabbedWindow. Inside the event handler, you can get the StackPanel that holds the header buttons. Then, you can insert new buttons on the panel.

[C#] Example 1: Subscribe to the ContextMenuOpening event

{{region cs-kb-add-additional-element-inside-radtabbedwindows-header-1}}
    private void RadTabbedWindow_Loaded(object sender, RoutedEventArgs e)
	{
		var stackWithButtons = this.ChildrenOfType<StackPanel>().FirstOrDefault( x=> x.Name == "HeaderButtons");
		if (stackWithButtons != null)
		{
			stackWithButtons.Children.Insert(0, new RadButton() { Content = "My Custom Button" });
		}
	}
{{endregion}}