Dynamic RadCombo with WebserviceSettings

2 posts, 0 answers
  1. cbospikes
    cbospikes avatar
    16 posts
    Member since:
    May 2007

    Posted 16 Jun 2009 Link to this post

    I am exploring building forms dynamically.
    I have gotten pretty far but I am of course battling an issue that could kill the whole concept.

    I am creating the radcombo from text in a database, using the .net reflection class

    ex.

    Dim

    thisAssembly As [Assembly] = [Assembly].GetExecutingAssembly()

     

     

    Dim RefAssembly As AssemblyName

     

     

    For Each RefAssembly In thisAssembly.GetReferencedAssemblies()

     

     

    Dim refAssembly2 As Assembly = [Assembly].Load(RefAssembly.FullName.ToString())

     

     

    Dim ct2 As Type = refAssembly2.GetType("Telerik.Web.UI.RadComboBox")

     

     

    Dim c2 As Object = Activator.CreateInstance(ct2)

     

     

    ....

    I am able to set most properties from information in the database like so:

    Dim prop As PropertyInfo = t2.GetProperty("EnableLoadOnDemand")

     

     

    Dim propval2 As Object = Convert.ChangeType("True", Type.[GetType]("System.Boolean"))

     

    prop.SetValue(c2, propval2,

    Nothing)

     

     

    However,
    There is a property I would like to set that I am having trouble with.
    The WebServiceSettings property is a class that does not contain a setvalue method.

    I've tried creating an instance of the webservicesettings class, setting its properties and using that object to set the
    webservicesettings property of the  radcombobox, but to no avail.

    I considered the approach of maybe using custom attributes to hold the path and method values and setting the corresponding properties client side but I didn't see that this was possible in the documentation and figured I had spent enough time on this to warrant posting and trying to get some direction.

    Thanks in advance for your help.



  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 17 Jun 2009 Link to this post

    Hello cbospikes,

    WebServiceSettings is readonly composite property. You should first get its value then use reflection on the returned value in order to set the Path and Method properties.

    Kind regards,
    Albert
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top