Hi,
When I right-click on the PivotGrid to get the context menu, how can I get the cell clicked on while the ContextMenu is opening?
Thanks
Sangeetha
Hi Petar,
Thank You for your reply.
You solution did not work for me as my ContextMenu was at the PivotGrid Level.
But I figured out a workable solution.
I use PivotGrid's CellControlAttached event to add a MouseRightButtonDown event to the cell. On MouseRightButtonDown I get the owner (which is the cell the context menu is invoked on).
Hi Sangeetha,
I can suggest you look into this reply I just posted: http://community.infragistics.com/forums/p/59753/306360.aspx#306360 whrer I have attached a sample project that gets the underlying cell in the ContextMenu Item’s Click event. In it I have bound the ContextMenu’s DataContext property to the TemplatedParent in the PivotCellControl’s template.
Please let me know if you require any further clarification on the matter.
Hi Todor,
Thanks for your reply. I already tried pivotGrid.CellClicked event. On right-click the context menu is invoked, so somehow cell-clicked is not fired.
And on right-click to invoke context menu, the pivot-cell clicked on is not selected.
Hi
There is a CellClicked event exposed by pivot
gridpivotGridXmla.CellClicked += new EventHandler<PivotCellClickedEventArgs>(pivotGridXmla_CellClicked);
Another way is to enable single selection for cell and in your opening event to check about selected cell
ThanksTodor