Adding GroupBar Item to GroupBar in WPF Navigation Pane (GroupBar)
6 May 20211 minute to read
GroupBar Item is added to the GroupBar using XAML or C# code. The following code illustrates this.
<!-- Adding GroupBar -->
<syncfusion:GroupBar Height="200" Width="230" Name="groupBar">
<!-- Adding GroupBarItem -->
<syncfusion:GroupBarItem Name="groupBarItem" Header="GroupBarItem"/>
</syncfusion:GroupBar>
//Creating an instance of GroupBar
GroupBar groupBar = new GroupBar();
//Creating an instance of GroupBar
ItemGroupBarItem groupBarItem = new GroupBarItem();
//Setting header for GroupBar itemgroup
BarItem.Header = "GroupBarItem";
//Adding GroupBar item to GroupBar
groupBar.Items.Add(groupBarItem);
//Adding GroupBar to the window
this.Content = groupBar;
NOTE
To display the GroupBar Item, you must have a GroupBar in which you are going to add the GroupBar Item.