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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Close GroupBar Popoup in compressed mode after selection

Thread ID:

Created:

Updated:

Platform:

Replies:

128676 Feb 5,2017 04:35 PM UTC Feb 7,2017 03:59 AM UTC WPF 3
loading
Tags: GroupBar
Bernd
Asked On February 5, 2017 04:35 PM UTC

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

Vijayalakshmi Roopkumar [Syncfusion]
Replied On 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. 


Bernd
Replied On 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

Vijayalakshmi Roopkumar [Syncfusion]
Replied On 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.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;