How to add telerik components through C# code?

4 posts, 0 answers
  1. Saad
    Saad avatar
    82 posts
    Member since:
    Oct 2008

    Posted 30 Oct 2008 Link to this post

    I want to add a telerik component in my page on pageload event....I tried to use page.Controls.Add(telerikComponent);
    But this function needs ASP components to pass as a parameter in, not the telerik components.....what to do for it plz help me!
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 30 Oct 2008 Link to this post

    Hello saadi,

    All Telerik RadControls for ASP.NET and ASP.NET AJAX are ASP.NET components/controls.

    Greetings,
    Vlad
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Saad
    Saad avatar
    82 posts
    Member since:
    Oct 2008

    Posted 30 Oct 2008 Link to this post

    I am trying to do this.....

    foreach

    (string file in Directory.GetFiles("<path>"))
    {
        System.Drawing.
    Image img = System.Drawing.Image.FromFile(file);
        RadButtonElement imageItem = new RadButtonElement();
        imageItem.ToolTipText =
    "Double click to resize";
        imageItem.Image = img;
        this.Items.Add(key,imageItem);  // i have tried everything to put in this key
    }

    but this.Items.Add(imageItem) isnt working....Excemption comes that is:
    An entry with the same key already exists.

     

  5. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 06 Nov 2008 Link to this post

    Hi saadi,

    I have reviewed you other tickets and therefore I suppose that you want to add a WinForms control to a ASP.NET web page. Please note that WinForms and ASP.NET are different branches of the .NET technology and therefore you cannot perform the desired operation.

    Best regards,
    Nikolay
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top