FieldsWindow are creating unnecesary fields

4 posts, 1 answers
  1. Guillermo
    Guillermo avatar
    13 posts
    Member since:
    Nov 2014

    Posted 04 Nov 2014 Link to this post

    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.
  2. Answer
    Angel Petrov
    Admin
    Angel Petrov avatar
    1007 posts

    Posted 07 Nov 2014 Link to this post

    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.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Guillermo
    Guillermo avatar
    13 posts
    Member since:
    Nov 2014

    Posted 07 Nov 2014 in reply to Angel Petrov Link to this post

    Thank you for your answer, I´ll try it inmediatly.

    Regards.
  5. Guillermo
    Guillermo avatar
    13 posts
    Member since:
    Nov 2014

    Posted 07 Nov 2014 Link to this post

    The fix is right.

    Thanks again and regards
Back to Top