This example demonstrates how RadToolTipManager can be used with a WCF WebService to retrieve customer information from the NorthWind database.
RadToolTipManager can load data on demand from a WCF Web Service since Q2 2014 SP1. The service must return the required HTML string and it receives an argument that defines the target element - by its ID and the Value property associated with it.
To configure the WCF Web Service call, simply set the Path and Method properties under WebServiceSettings to the desired *.svc file and to the method that needs to be called.
The context object that defines the target is a Dictionary and you can create a simple class to access the information:
[OperationContract]
public
string
TheWcfServiceMethod(ToolTipContext context)
{
string
theValue = context.Value;
string
theTargetId = context.TargetControlID;
return
"the desired content"
;
}
where the ToolTipContext class can implement the dictionary for you:
[Serializable]
public
class
ToolTipContext : Dictionary<
string
,
object
>
{
public
string
Value
{
get
{
return
(
string
)
this
[
"Value"
]; }
set
{
this
[
"Value"
] = value; }
}
public
string
TargetControlID
{
get
{
return
(
string
)
this
[
"TargetControlID"
]; }
set
{
this
[
"TargetControlID"
] = value; }
}
}
The LiveDemos folder (in your installation directory) contains the full code of the examples and once you open the solution you can find the full code of the webservice (ultimately in the ~/App_Code/ToolTipWcfService.cs file).
Mouseover the images below to view detailed information about each person.