This is a migrated thread and some comments may be shown as answers.

FieldsWindow are creating unnecesary fields

3 Answers 80 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Guillermo
Top achievements
Rank 1
Guillermo asked on 04 Nov 2014, 07:38 AM
Hi.

Actually i´m using a PivotGrid and when a FieldsWindow is displayed and the fields are offered to choose, some of them are created by the control.

How is possible to hide or desactivate them?

Thanks in advance.

3 Answers, 1 is accepted

Sort by
0
Accepted
Angel Petrov
Telerik team
answered on 07 Nov 2014, 06:57 AM
Hello Guillermo,

In order to remove the auto-generated fields you can subscribe to the OnFieldCreated event and execute the following logic.

C#:
protected void RadPivotGrid1_FieldCreated(object sender, PivotGridFieldCreatedEventArgs e)
    {
        if (e.Field.UniqueName.Contains("Year") || e.Field.UniqueName.Contains("Quarter") || e.Field.UniqueName.Contains("Day") || e.Field.UniqueName.Contains("Month")
            || e.Field.UniqueName.Contains("Week") || e.Field.UniqueName.Contains("Minute") || e.Field.UniqueName.Contains("Hour")
            || e.Field.UniqueName.Contains("Second"))
        {
            RadPivotGrid1.Fields.Remove(e.Field);
        }
    }


Regards,
Angel Petrov
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
Guillermo
Top achievements
Rank 1
answered on 07 Nov 2014, 08:24 AM
Thank you for your answer, I´ll try it inmediatly.

Regards.
0
Guillermo
Top achievements
Rank 1
answered on 07 Nov 2014, 08:32 AM
The fix is right.

Thanks again and regards
Tags
PivotGrid
Asked by
Guillermo
Top achievements
Rank 1
Answers by
Angel Petrov
Telerik team
Guillermo
Top achievements
Rank 1
Share this question
or