3 Answers, 1 is accepted
0
Accepted
Hello Manuele,
Thank you for writing.
In order to sort the items in the PivotReportFilterPopup and PivotGroupFilterPopup, it is appropriate to use its PopupOpened.Here is a sample code snippet regarding the PivotReportFilterPopup:
As to your second question, I am not completely sure that I understand your requirement. By default, when you add a PropertyFilterDescription to the FilterDescriptions for a DateTime property, it offers a dialog, which contains a list with distinct column values, from which the end user can chose. Please refer to the attached screenshot. Could you please give us some more details about the desired look that you are trying to achieve? Thank you in advance.
I am looking forward to your reply.
Regards,
Dess
Telerik
Thank you for writing.
In order to sort the items in the PivotReportFilterPopup and PivotGroupFilterPopup, it is appropriate to use its PopupOpened.Here is a sample code snippet regarding the PivotReportFilterPopup:
private void Form1_Load(object sender, EventArgs e){ this.ordersTableAdapter.Fill(this.nwindDataSet.Orders); this.radPivotGrid1.ShowFilterArea = true; this.radPivotGrid1.FilterDescriptorElementCreating += radPivotGrid1_FilterDescriptorElementCreating; this.radPivotGrid1.RowGroupDescriptions.Add(new DateTimeGroupDescription() { PropertyName = "OrderDate", Step = DateTimeStep.Year, GroupComparer = new GroupNameComparer() }); this.radPivotGrid1.RowGroupDescriptions.Add(new DateTimeGroupDescription() { PropertyName = "OrderDate", Step = DateTimeStep.Quarter, GroupComparer = new GroupNameComparer() }); this.radPivotGrid1.RowGroupDescriptions.Add(new DateTimeGroupDescription() { PropertyName = "OrderDate", Step = DateTimeStep.Month, GroupComparer = new GroupNameComparer() }); this.radPivotGrid1.ColumnGroupDescriptions.Add(new PropertyGroupDescription() { PropertyName = "EmployeeID", GroupComparer = new GrandTotalComparer() }); this.radPivotGrid1.AggregateDescriptions.Add(new PropertyAggregateDescription() { PropertyName = "Freight", AggregateFunction = AggregateFunctions.Sum }); this.radPivotGrid1.AggregateDescriptions.Add(new PropertyAggregateDescription() { PropertyName = "Freight", AggregateFunction = AggregateFunctions.Average }); this.radPivotGrid1.FilterDescriptions.Add(new PropertyFilterDescription() { PropertyName = "ShipCountry", CustomName = "Country" }); this.radPivotGrid1.DataSource = this.ordersBindingSource;}private void radPivotGrid1_FilterDescriptorElementCreating(object sender, FilterDescriptorElementCreatingEventArgs e){ e.FilterDescriptorElement.FilterPopup.PopupOpened += FilterPopup_PopupOpened;}bool customized = false;private void FilterPopup_PopupOpened(object sender, EventArgs args){ PivotReportFilterPopup popup = sender as PivotReportFilterPopup; if (!customized) { //move item RadItem itemToMove = popup.Items[1]; popup.Items.Remove(itemToMove); popup.Items.Insert(popup.Items.Count - 1, itemToMove); //sort tree nodes popup.TreeItem.TreeElement.TreeView.SortOrder = System.Windows.Forms.SortOrder.Descending; customized = true; }}As to your second question, I am not completely sure that I understand your requirement. By default, when you add a PropertyFilterDescription to the FilterDescriptions for a DateTime property, it offers a dialog, which contains a list with distinct column values, from which the end user can chose. Please refer to the attached screenshot. Could you please give us some more details about the desired look that you are trying to achieve? Thank you in advance.
I am looking forward to your reply.
Dess
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
manuele
Top achievements
Rank 1
answered on 24 Mar 2015, 03:17 PM
Thank you for the support.
Excel filter for DateTime value show a TreeView grouped by Year and Month
i would like to add a filter like the screenshot attached
Thanks
Regards
Manuele
Excel filter for DateTime value show a TreeView grouped by Year and Month
i would like to add a filter like the screenshot attached
Thanks
Regards
Manuele
0
Hello Manuele,
Thank you for writing back.
The RadTreeView in the PivotReportFilterPopup displays all distinct values. Hence, all dates will be shown as nodes.
In order to change this default functionality, you can use the FilterDescriptorElementCreatingEventArgs.FilterDescriptorElement.FilterPopup.PopupOpened event and manipulate the Nodes collection for the PivotReportFilterPopup.TreeItem.TreeElement.TreeView. However, in this case you should manually perform the filtering when checking/unchecking nodes.
I hope this information helps. If you have any additional questions, please let me know.
Regards,
Dess
Telerik
Thank you for writing back.
The RadTreeView in the PivotReportFilterPopup displays all distinct values. Hence, all dates will be shown as nodes.
In order to change this default functionality, you can use the FilterDescriptorElementCreatingEventArgs.FilterDescriptorElement.FilterPopup.PopupOpened event and manipulate the Nodes collection for the PivotReportFilterPopup.TreeItem.TreeElement.TreeView. However, in this case you should manually perform the filtering when checking/unchecking nodes.
I hope this information helps. If you have any additional questions, please let me know.
Regards,
Dess
Telerik
See What's Next in App Development. Register for TelerikNEXT.
