Good morning,
I have a few problems with PivotGridControl.
1. How can I edit the MultiFunctionalSortFilter. I need to allow the user to stretch it, because the data in the filters is long (proper names of products). Additionally, I need to change the color of the Ok and Cancel buttons
2. I added options using syncfusion:PivotSchemaDesigner. When the user uses the PART_DeferLayoutUpdate option, the data in PivotGrid disappears. How can I prevent this?
I will be very grateful for any help.
Kind regards
Hi Piotr,
Query |
Comments |
How can I edit the MultiFunctionalSortFilter. I need to allow the user to stretch it, because the data in the filters is long (proper names of products). |
We are a little unclear about the details provided. Specifically, we are unsure if you want to increase the size of the content in FilterPopup or if there is another item you mentioned. Could you please provide a detailed explanation, along with an image illustration? This information would be helpful for further investigation. |
Additionally, I need to change the color of the Ok and Cancel buttons |
You can change the background of the Ok Cancel button in a FilterPopup by using the GroupingBar.MultiFunctionalSortFilterPopup.Opened event. Refer to the code snippets below for more information. public MainWindow() { InitializeComponent(); this.pivotGrid.Loaded += PivotGrid_Loaded;
}
private void PivotGrid_Loaded(object sender, RoutedEventArgs e) { pivotGrid.GroupingBar.Loaded += GroupingBar_Loaded; }
private void GroupingBar_Loaded(object sender, RoutedEventArgs e) { pivotGrid.GroupingBar.AllowMultiFunctionalSortFilter = true; pivotGrid.GroupingBar.MultiFunctionalSortFilterPopup.Opened += MultiFunctionalSortFilterPopup_Opened; }
private void MultiFunctionalSortFilterPopup_Opened(object sender, EventArgs e) { LoadPopupContent(pivotGrid); } private static void LoadPopupContent(PivotGridControl control) { var multiFilterPopup = control.GroupingBar.MultiFunctionalSortFilterPopup; var applyButton = multiFilterPopup.GetType().GetProperty("ApplyButton", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).GetValue(multiFilterPopup) as Button; var cancelButton = multiFilterPopup.GetType().GetProperty("CancelButton", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).GetValue(multiFilterPopup) as Button; applyButton.Background = new SolidColorBrush(Colors.Red); cancelButton.Background = new SolidColorBrush(Colors.Aqua); } |
I added options using syncfusion:PivotSchemaDesigner. When the user uses the PART_DeferLayoutUpdate option, the data in PivotGrid disappears. How can I prevent this? |
We have also used DeferLayoutUpdate as true, but unfortunately, we haven't received any data disappearance issue. Could you please share the code snippets or an issue reproducible sample? It will be helpful to investigate further. Suggestions: You can try and calling the method 'pivotGrid.InternalGrid.Refresh(true);' to populate the data again. |
Regards,
Sathiyathanam
I would like to add textWrap to PARTExcel_FilterPopupListBox ListBox item template (textBlock). - in my case values can be pretty long and they don't fit in popup.
2. It would be perfect if user could stretch MultiFunctionalSortFilterPopup
One more problem :)
How to make PivotGrid more responsive? PivotGrid is displayed at different resolutions from 1360x768 to 4K...
Piotr,
We are currently checking the feasibility to achieve your requirement. We will update the details on March 23,2023.
Piotr,
Query |
Comments |
I would like to add textWrap to PARTExcel_FilterPopupListBox ListBox item template (textBlock). - in my case values can be pretty long and they don't fit in popup. 2. It would be perfect if user could stretch MultiFunctionalSortFilterPopup
|
There is no direct way to achieve your requirement. However, your requirement can be achieved by changing the ItemTemplate of the FilterListBox. Refer to the below code snippets for more information. XAML <Application.Resources> <DataTemplate x:Key="itemTemplate"> <CheckBox IsChecked="{Binding IsSelected, Mode=TwoWay}" Foreground="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type syncfusion:PivotGridControl}}, Path=GroupingBarItemForeground}"> <TextBlock Text="{Binding Key}" TextWrapping="Wrap" /> </CheckBox> </DataTemplate> <Style x:Key="listBoxStyle" TargetType="ListBox"> <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/> </Style> </Application.Resources> C# private void GroupingBar_Loaded(object sender, RoutedEventArgs e) { pivotGrid.GroupingBar.AllowMultiFunctionalSortFilter = true; pivotGrid.GroupingBar.MultiFunctionalSortFilterPopup.Opened += MultiFunctionalSortFilterPopup_Opened; }
private void MultiFunctionalSortFilterPopup_Opened(object sender, EventArgs e) { LoadPopupContent(pivotGrid); } private void LoadPopupContent(PivotGridControl control) { var multiFilterPopup = control.GroupingBar.MultiFunctionalSortFilterPopup; control.GroupingBar.MultiFunctionalSortFilterPopup.FilterListBox.ItemTemplate = App.Current.Resources["itemTemplate"] as DataTemplate; control.GroupingBar.MultiFunctionalSortFilterPopup.FilterListBox.Style = App.Current.Resources["listBoxStyle"] as Style; var applyButton = multiFilterPopup.GetType().GetProperty("ApplyButton", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).GetValue(multiFilterPopup) as Button; var cancelButton = multiFilterPopup.GetType().GetProperty("CancelButton", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).GetValue(multiFilterPopup) as Button; applyButton.Background = new SolidColorBrush(Colors.Red); cancelButton.Background = new SolidColorBrush(Colors.Aqua);
} |
How to make PivotGrid more responsive? PivotGrid is displayed at different resolutions from 1360x768 to 4K...
|
Refer to the below KB to improve the performance of PivotGrid. https://www.syncfusion.com/kb/2882/how-to-increase-the-pivot-grid-performance |