4 Answers, 1 is accepted
0
rho
Top achievements
Rank 1
answered on 11 Nov 2013, 03:53 PM
Please add this very usefull function.
It's often requested to offer drill-down functions, which then would be possible.
Thanks
It's often requested to offer drill-down functions, which then would be possible.
Thanks
0
Hello Glen,
There are several ways to achieve the desired functionality. First one is to handle MouseLeftButtonUp (or MouseLeftButtonDown or any other Mouse event) and get the clicked element in the following way:
You can also add RadContextMenu to RadPivotGrid which will be shown when you right click on the pivot:
And one more option - you can change RadPivotGrid's CellTemplate and put whatever element you need (for example HyperlinkButton).
I've prepared a sample project demonstrating all of the above. Please give it a try and inform us in case you have any problems or concerns.
Regards,
Rosen Vladimirov
Telerik
There are several ways to achieve the desired functionality. First one is to handle MouseLeftButtonUp (or MouseLeftButtonDown or any other Mouse event) and get the clicked element in the following way:
var clickedElement = e.OriginalSource
as
FrameworkElement;
if
(clickedElement ==
null
)
{
return
;
}
var cellData = clickedElement.DataContext
as
CellData;
if
(cellData !=
null
)
{
MessageBox.Show(
"Clicked element is: "
+ cellData.Data +
" RowItem = "
+ cellData.RowItem +
" ColumnItem "
+ cellData.ColumnItem);
}
You can also add RadContextMenu to RadPivotGrid which will be shown when you right click on the pivot:
<
pivot:RadPivotGrid
x:Name
=
"radPivotGrid"
MouseLeftButtonUp
=
"radPivotGrid_MouseLeftButtonUp"
CellTemplate
=
"{StaticResource CustomCellTemplate}"
DataProvider
=
"{StaticResource LocalDataProvider}"
>
<
telerik:RadContextMenu.ContextMenu
>
<
telerik:RadContextMenu
>
<
telerik:RadMenuItem
Header
=
"Item 1"
/>
</
telerik:RadContextMenu
>
</
telerik:RadContextMenu.ContextMenu
>
</
pivot:RadPivotGrid
>
And one more option - you can change RadPivotGrid's CellTemplate and put whatever element you need (for example HyperlinkButton).
I've prepared a sample project demonstrating all of the above. Please give it a try and inform us in case you have any problems or concerns.
Regards,
Rosen Vladimirov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Asuman
Top achievements
Rank 1
answered on 03 Jan 2016, 12:05 PM
Hi Rosen,
Thanks for sharing the solution. Can we get property names of the rows and columns of the clicked cell?
0
Hi Asuman,
In the particular sample you can get the second level parent headers as shown below:
Hope this helps.
Regards,
Kalin
Telerik
In the particular sample you can get the second level parent headers as shown below:
var col = (cellData.ColumnItem
as
Telerik.Pivot.Core.IGroup).Parent.Name;
var row = (cellData.RowItem
as
Telerik.Pivot.Core.IGroup).Parent.Name;
Hope this helps.
Regards,
Kalin
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