Hi,
In ActiveCellChanged event (xamPivotGrid) I want to get the cell COORDINATE like :
"Sales", "[City].[All City].[New York]"
of the selected cell.
Any ideas ?
Regards,
Dimitris
Thank you !
Hi
You can find out the level depth by count of private collection for row and column area.
this.pivotGrid.GridLayout.PrivateColumnsForRowPanel
this.pivotGrid.GridLayout.PrivateRowsForColumnPanel
Also the header cell has Member property which gives you a info about hierarchy and dimension.
rowHeaderCell.Member
Todor
Todor,
Thank you for your prompt answer.
As I understand you say that I have to build the coordinate by identifying the exact position.
How can I know the depth ?
I mean if I have selected a cell on a pivot drilled up to City level :
"[City].[All City].[New York]"
or drilled on all Cities level :
"[City].[All City]"
(if Cities are not expanded)
or even if on the columns area we have expanded a Date hierarchy ?
You can use code below:
int columnIndex = pivotGrid.DataColumns.IndexOf(pivotGrid.ActiveCell.Column as PivotDataColumn); int rowIndex = pivotGrid.DataRows.IndexOf(pivotGrid.ActiveCell.Row as PivotDataRow); PivotHeaderCell columnHeaderCell = pivotGrid.GridLayout.ColumnHeaderCellsProvider.GetCell(0, columnIndex); PivotHeaderCell rowHeaderCell = pivotGrid.GridLayout.RowHeaderCellsProvider.GetCell(rowIndex, 0);
Be aware that when you get row header cell, the columnIndex parameter of GetCell method is a index of columns in row header area only not the index in data area. See picture.
RegardsTodor