Hi
I have created a TelerikPivotGrid which displays a count of record per department and Type.
The data in the cell within the grid is clickable, and when a user clicks on I need to get the name of the column and name of the row for the cell they have clicked on.
Please can anyone advise how to get the values of the grid when a user clicks on the cell within the grid?
Thank you
im not sure how to get the value of the column header title and the row title once the user clicks on the link?
Hi Rakhee,
I am afraid that there is no built-in API for this purpose in RadPivotGrid. What you can possibly do is use some native JavaScript (and/or jQuery) to reach the desired DOM elements and read the text inside.
Here's an example that can serve as a starting point:
Please note that the specific logic and selectors in this example depend on your PivotGrid's configuration and content. You may need to make adjustments to the code accordingly.
If you find any additional functionality missing or have other feature requests, we encourage you to log them into our feedback portal. Your feedback is valuable to us, and it helps us improve our products to better meet your needs. You can access the Feedback portal here.
Hi Doncho
Thank you. Can you advise what the 'thead th' and '.rpgRowsZone' is a reference to?
This is my grid
<telerik:RadPivotGrid RenderMode="Lightweight" Height="700px"ID="rpgCallSummary" runat="server">
<Fields>
<telerik:PivotGridRowField DataField="Department" ZoneIndex="0">
</telerik:PivotGridRowField>
<telerik:PivotGridColumnField DataField="CallType"></telerik:PivotGridColumnField>
<telerik:PivotGridAggregateField DataField="CallNumber" Aggregate="Count">
<CellTemplate>
<asp:LinkButton ID="lnkCallDetails" runat="server" OnClick="lnkCallDetails_Click" Text='<%# GetDataItem() %>'></asp:LinkButton>
</CellTemplate>
</telerik:PivotGridAggregateField>
</Fields>
</telerik:RadPivotGrid>
Hi Rakhee,
The strings in question are native jQuery selectors for getting a reference to certain DOM elements on the page. The ones I shared are just examples on how column and row header cell could be accessed. Yet, the same selectors would work with specific PivotGrid configuration, and they should be modified as per the specific scenario.
Please keep in mind that the main purpose of the RadPivotGrid is to visualize and summarize data of your choice. It rather uses the calculated values from the data fields to build various reports to display and highlight the desired information. Its intentions are not to modify data or execute CRUD operations.
That said, accessing data items, header, cell, rows etc. is a specialty of the RadGrid control and is not supported by the RadPivotGrid control.
You can check the following resource for additional info about the RadPivotGrid purpose and functionality:
https://www.telerik.com/blogs/aspnet-pivot-table-made-easy
Also, you can check these posts for its differences with RadGrid:
https://www.telerik.com/forums/getting-access-to-strongly-typed-object-that-i%27ve-bound-the-pivotgrid-to#jxWdB_kWmkSoMCDwSiVj_g
https://www.telerik.com/forums/template-column-for-pivot-grid#ro_LCNv1N0GIQ46Jj0413w
https://www.telerik.com/forums/compare-cell-value-to-his-grand-total#fKkrL5GUaEenSX4wWTc7wg