Telerik hide PivotGridCalculatedItem programmatically

2 posts, 0 answers
  1. Sagar
    Sagar avatar
    6 posts
    Member since:
    Feb 2016

    Posted 26 Feb Link to this post

    Hi ,

    I want to hide PivotGridCalculatedItem column programmatically on checkbox change event,is there any provision to do so.

     

    Thanks,

    Sagar Jaunjalkar

  2. Eyup
    Admin
    Eyup avatar
    3015 posts

    Posted 02 Mar Link to this post

    Hello Sagar,

    You can use the following approach to achieve this requirement:
    protected void Button1_Click(object sender, EventArgs e)
    {
        PivotGridColumnField field = RadPivotGrid1.Fields["Year"] as PivotGridColumnField;
        var calItems = field.CalculatedItems.OfType<PivotGridCalculatedItem>();
        PivotGridCalculatedItem item = calItems.Where(x => x.GroupName == "Forecast for 1999").FirstOrDefault();
        field.CalculatedItems.Remove(item);
        RadPivotGrid1.Rebind();
    }

    The example above is adjusted for this live sample:
    http://demos.telerik.com/aspnet-ajax/pivotgrid/examples/calculations/defaultcs.aspx

    I hope this will prove helpful.

    Regards,
    Eyup
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top