This example illustrates how to add a search box to the field list control.
Our PivotExcelFieldListControl uses the TreeViewFieldsPresenter component to show fields in a tree-like view. In this example, we create a TreeViewFieldsPresenter control descendant and implement the filtering functionality at its level. The default TreeViewFieldsPresenter is replaced with our descendant via styles.
Important: The provided approach works when fields are grouped via User Folders. In OLAP mode, fields are grouped automatically. If fields are not grouped, PivotGrid uses another control (not TreeViewFieldsPresenter ) to manage hidden fields and custom style is not used.
Question Comments
Added By: Constant (DevExpress Support) at: 10/9/2015 2:42:04 AM This solution works for the grouped field list. In the OLAP mode, fields are grouped in the customization form by default. In the traditional binding mode, it is possible to group fields manually by specifying the PivotGridField.DisplayFolder Property for all or just some of them. This solution also helps to simplify layout customization if a lot of fields are available. Added By: Angshuman Agarwal 1 at: 8/29/2016 11:01:27 AM Hi,
Getting error while running this sample in 15.1.8
[C#]Anexceptionoftype'DevExpress.XtraPivotGrid.Data.OLAPConnectionException' occurredinDevExpress.PivotGrid.v15.1.Core.dllbutwasnothandledinusercodeAdditionalinformation:Couldn'tconnecttotheAnalysisServices.
Can someone please look into this ?
regards
Angshuman
Added By: Alex (DevExpress Support) at: 8/30/2016 12:00:19 AM
Hi Angshuman,
I have tested the example using v15.1 assemblies, and the OLAP server specified using the OlapConnectionString property works without errors. If you are using a different OLAP data source, check to see that the provided connection string is valid.