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
close icon

Close GroupBar Popoup in compressed mode after selection

Hi,

I have a GroupBar which can be compressed. When I click on "Navigation Pane" I get the ppoup with the entries. If I select one entry all works fine but the popup stays open. How can  have it close after the selection is made?

BTW. Can I customize the text "Navigation Pane" to show the title of the current selected item?

Regards
Bernd

3 Replies

VR Vijayalakshmi Roopkumar Syncfusion Team February 6, 2017 10:50 AM UTC

Hi Bernd,

Thank you for contacting Syncfusion Support.

Query 1: How can hide the Navigation Popup, once its selection is made?

This reported requirement can be achieved by handling Selected Event in GroupViewItem and by customizing its Template. Please make use of below code snippet for your reference. 
Code Snippet:[C#] 
  
#region event 
  
//Event invokes when the Groupbarloaded 
private void MyGroupBar_Loaded(object sender, RoutedEventArgs e) 
{ 
pop1 = myGroupBar.Template.FindName("PART_Popup", myGroupBar) as Popup; 
  
pop1.Opened += Pop1_Opened; 
} 
  
  
//Even which invokes when the popup opens 
private void Pop1_Opened(object sender, EventArgs e) 
{ 
Border border = myGroupBar.Template.FindName("PopupResizePart", myGroupBar) as Border; 
GroupView groupview1 = VisualUtils.FindDescendant(border, typeof(GroupView)) as GroupView; 
if (groupview1 != null) 
{ 
foreach (GroupViewItem item in groupview1.Items) 
{ 
item.Selected += Item_Selected; 
  
} 
} 
  
} 
  
//Event that invokes when the GroupViewItem get selected 
private void Item_Selected(object sender, RoutedEventArgs e) 
{ 
  
pop1 = myGroupBar.Template.FindName("PART_Popup", myGroupBar) as Popup; 
GroupViewItem item = sender as GroupViewItem; 
if(item.IsSelected) 
{ 
//used to set the selected groupitem text 
myGroupBar.NavigationPaneText = item.Text; 
//used to close the popup 
pop1.IsOpen = false; 
} 
} 
  
  
#endregion 
  
 
This below video demonstrates the required functionality in GroupBar. Kindly check with below video. 
  
Query 2 : Can I customize the text "Navigation Pane" to show the title of the current selected item? 
This reported requirement can be achieved by using NavigationPaneText property. Please make use below code snippet for your reference. 
Code Snippet:[C#] 
 
//Event that invokes when the GroupViewItem get selected 
private void Item_Selected(object sender, RoutedEventArgs e) 
{ 
  
pop1 = myGroupBar.Template.FindName("PART_Popup", myGroupBar) as Popup; 
GroupViewItem item = sender as GroupViewItem; 
if(item.IsSelected) 
{ 
//used to set the selected groupitem text 
myGroupBar.NavigationPaneText = item.Text; 
} 
} 
  
 
 Screenshot 
  
We have prepared sample for your reference and it can be downloaded from below location. 
Can you please check with above solution and Kindly let us know if it helps. 
Regards,
Vijayalakshmi V.R. 



BE Bernd February 6, 2017 11:57 AM UTC

Vijayalakshmi,

it feels a bit complicated to accomplish it this way but it works.

Thank you for your support.

Regards
Bernd


VR Vijayalakshmi Roopkumar Syncfusion Team February 7, 2017 03:59 AM UTC

Hi Bernd,

Thank you for the update.

Please let us know if you need any further assistance on this.

Regards,
Vijayalakshmi V.R.

Loader.
Live Chat Icon For mobile
Up arrow icon