How to use load on demand for RadPivotGrid tooltips.
The goal is to replace the string the pivot grid generates automatically with custom data coming from a database or other source.
RadPivotGrid does not do load on demand by default, it generates the tooltip strings based on the server values and DOM attributes.
A sample that allows you to call a web service is attached below.
Requirements:
- A pivot grid bound to data with EnableToolTips set to true.
- A function override that changes the original tooltip behavior to prevent the default text from being re-inserted and thus, preventing multiple requets to the web service.
- A web service that will return the formatted string with data (can contain HTML but should not contain IScriptControl instances like the Telerik UI for ASP.NET AJAX controls).
- A handler to the OnToolTipShow event of the pivot grid that will determine what data is sent to the service.
- The Northwind database (you can obtain it from the Telerik Live Demos).
Limitations:
- Load on demand can only be used with web services, AJAX requests to the current page will break the pivot grid and will cause various errors.
- If you need data that is not provided by the title attribute of the current cell, you will need to traverse the DOM manually in order to provide it to the web service.
- If issues arise with a future version, they may be caused by the function override that does not allow you to fetch the new code. In such cases, review the source code and transfer the changes.
Related resources: