Accessing .NET RadComboBox from Silverlight

2 posts, 0 answers
  1. Christophe Bienaime
    Christophe Bienaime avatar
    9 posts
    Member since:
    Dec 2009

    Posted 24 Apr 2012 Link to this post

    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 ! 
  2. Christophe Bienaime
    Christophe Bienaime avatar
    9 posts
    Member since:
    Dec 2009

    Posted 25 Apr 2012 Link to this post

    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. 


  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top