Setting ToolTip for GroupBar in WPF Navigation Pane (GroupBar)

6 May 20211 minute to read

ToolTip is one of the important user interactive feature available in GroupBar control. You can set the tooltip for the collapse button and expand button using the properties listed below.

Property table

Property Description
CollapseButtonToolTip Gets or sets the tooltip to be displayed when mouse is hovered over the collapse button.
ExpandButtonToolTip Gets or sets the tooltip to be displayed when mouse is hovered over the expand button.

Use the below code snippet to set this property.

<!-- Adding GroupBar -->
<syncfusion:GroupBar Height="200" CollapseButtonToolTip="Expand"  VisualMode="StackMode" AllowCollapse="True"  ExpandButtonToolTip="Collapse" Width="230" Name="groupBar"> 
 <!-- Adding GroupBarItem -->  
 <syncfusion:GroupBarItem Name="groupBarItem" Header="GroupBarItem">
 <!-- Adding content for GroupBar item using panel -->   
 <StackPanel Orientation="Vertical">   
 <TextBlock Text="GroupBar Orientation" Margin="4,4,2,2"/> 
 <RadioButton IsChecked="True" Margin="4,2,2,2">Horizontal</RadioButton>  
 <RadioButton Margin="4,2,2,2">Vertical</RadioButton>   
 <TextBlock Text="GroupView Orientation" Margin="4,4,2,2"/>  
 <RadioButton Margin="4,2,2,2">Horizontal</RadioButton>   
 <RadioButton IsChecked="True" Margin="4,2,2,2">Vertical</RadioButton>  

 <!-- Adding GroupBarItem --> 
 <syncfusion:GroupBarItem Name="groupBarItem1" HeaderImageSource="Label.gif" Header="General">   
 <!-- Adding content for GroupBar item using GroupView -->
 <syncfusion:GroupView Name="groupView" IsListViewMode="True">  
 <syncfusion:GroupViewItem Text="List View"/>     
 <syncfusion:GroupViewItem Text="Show ContextMenu"/>    
 <syncfusion:GroupViewItem Text="Show ToolTip"/>   

//Setting the visual mode as StackMode
groupBar.VisualMode = VisualMode.StackMode;  
//Setting AllowCollapse property
groupBar.AllowCollapse = true;
//Setting the tooltip for Expand button
groupBar.ExpandButtonToolTip = "Collapse";
//Setting the tooltip for Collapse button
groupBar.CollapseButtonToolTip = "Expand";