Nowadays, with the increasing adoption of Silverlight, it is not uncommon to integrate one or more Silverlight controls in an existing asp.net website. More or less, it utilizes the integration logic demonstrated in this Telerik TV entry - http://tv.telerik.com/watch/silverlight/webinar/radcontrols-silverlight-aspnet and Manol’s blogpost - http://blogs.telerik.com/manoldonev/posts/09-03-17/silverlight_radchart_interoperability_with_asp_net.aspx . If you want to know how RadMap for Silverlight can be bound to RadGrid in ASP.NET go ahead and keep reading.
The most important steps are as follows:
1. Prepare the Silverlight application, adding references to the dlls of the controls it contains. In our case, this is a simple XAML page, containing a RadMap control:
2. The next important segment is the aspx page, which will host the SL object. Again, this is pretty straightforward. In our case, it contains a RadGrid component, along with the mandatory ScriptManager. There are two interesting details:
- The Silverlight object, which is directly embedded in the aspx page contains the map control.
- The pluginLoaded event handler - here you can obtain a reference to the Silverlight plugin that secures the interaction between the ASP.NET Grid control and the Silverlight RadMap.
The code below demonstrates this:
As evident from the code above, once we have a reference to the SL plugin in the pluginLoaded event handler, we can communicate with the Map control:
You can download the full source code from
Telerik XAML Team