Access Cell

4 posts, 0 answers
  1. Shaun
    Shaun avatar
    37 posts
    Member since:
    Sep 2012

    Posted 25 Mar 2013 Link to this post

    HI,

    Just installed the latest release,  Q1 2013 SP1 (version 2013.1.321)

    RadPivotGrid

    • IMPROVED: Exposed a method for accessing cell values.
    • FIXED: Unable to open the Filter Popup Dialog when filter items contain DBNULL values.


    How do I access the cell values as stated above?

    Also is it possible to add a calculation field to a pivot grid?

    Cheers

    Shaun.

  2. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 28 Mar 2013 Link to this post

    Hello Shaun,

    Thank you for writing.

    You should use the RadPivotGridElement's 
    GetAggregateValue method in order to access cells value. Refer to the method signature:
    public CellAggregateValue GetAggregateValue(IGroup row, IGroup column, bool collapsedRow, bool collapsedColumn)

    The item concerns a Pivot calculations is still not resolved.

    Should you have any other questions, do not hesitate to contact us.

    Greetings,
    Peter
    the Telerik team
    WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Shaun
    Shaun avatar
    37 posts
    Member since:
    Sep 2012

    Posted 08 Apr 2013 Link to this post

    Hi,

    Thanks for that, do you have a code example as I'm not having much luck accessing the cells.

    Cheers

    Shaun. 
  5. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 10 Apr 2013 Link to this post

    Hello Shaun,

    Thank you for writing back.

    You can you this method in this way:
       this.radPivotGrid1.UpdateCompleted += new EventHandler(radPivotGrid1_UpdateCompleted);
       this.FillWithData();           
    }
     
    void radPivotGrid1_UpdateCompleted(object sender, EventArgs e)
    {
        foreach (PivotGroupNode columnNode in this.radPivotGrid1.PivotGridElement.GetColumnGroups())
        {
            foreach (PivotGroupNode rowNode in this.radPivotGrid1.PivotGridElement.GetRowGroups())
            {
                CellAggregateValue value = this.radPivotGrid1.PivotGridElement.GetAggregateValue(columnNode.Group, rowNode.Group, false, false);
                if (!string.IsNullOrEmpty(value.FormattedValue))
                {
                    //deal with the cell value
                }
            }
        }
    }

    I hope this is helpful.

    Do not hesitate to write back anytime you have further questions or need assistance.

    Greetings,
    Peter
    the Telerik team
    WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
Back to Top