This is a migrated thread and some comments may be shown as answers.

Accessing .NET RadComboBox from Silverlight

1 Answer 52 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Christophe Bienaime
Top achievements
Rank 1
Christophe Bienaime asked on 24 Apr 2012, 10:39 AM
Hello,

I have an aspx page with a RadComboBox an a silverlight object in it : 
<telerik:RadComboBox ID="cbListeTypesDonnees" runat="server" SkinID="cbMiddleComboBox" />
 
<div id="silverlightControlHost">
        <object data="data:application/x-silverlight-2," type="application/x-silverlight-2"
                              width="600px" height="500px" id="moduleSL">
               <param name="source" value="../../ClientBin/Genius.UI.Modules.DonneesExogenes.xap" />
               <param name="onError" value="onSilverlightError" />
                <param name="background" value="white" />
                 <param name="minRuntimeVersion" value="4.0.50401.0" />
                 <param name="autoUpgrade" value="true" />
                  <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50401.0" style="text-decoration: none">
                       <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight"
                                     style="border-style: none" />
                  </a>
              </object>
</div>


I want access to the RadComboBox when I am in my silverlight code : 
public partial class MainPage : UserControl
    {
 
 private void _serviceClient_GetAllValeursDonneeExogeneCompleted(object sender, GetAllValeursDonneeExogeneCompletedEventArgs e)
        {
            if (HtmlPage.Document.GetElementById("cbListeTypesDonnees") != null)
            {
                
            }
        }

Unfortunately, this code doesn't work, my cbListeTypesDonnees is always null. 
It works when my combobox is not a telerik control. 
How can I get the RadComboBox from Silverlight ? 

Thank you ! 

1 Answer, 1 is accepted

Sort by
0
Christophe Bienaime
Top achievements
Rank 1
answered on 25 Apr 2012, 02:18 PM
I found myself the solution. 

In Silverlight, I use the HtmlPage.Window.Invoke method to call a javascript function in my aspx page. 
And I update my combobox in this javascript function. 


Tags
ComboBox
Asked by
Christophe Bienaime
Top achievements
Rank 1
Answers by
Christophe Bienaime
Top achievements
Rank 1
Share this question
or