RadImageItem Image Size

4 posts, 0 answers
  1. Developer Developer
    Developer Developer avatar
    34 posts
    Member since:
    Sep 2005

    Posted 17 Sep 2010 Link to this post

    I'd like for images within a RadImageItem to resize as the RadRotator resizes.  Does anyone know how to do this?  

    Any help would be greatly appreciated.  Thank you!
  2. Jack
    Jack avatar
    2333 posts

    Posted 23 Sep 2010 Link to this post


    Thank you for this question.

    Currently this feature is not implemented in RadRotator. However, you can achieve this with a few lines of code. Please consider the following code snippet:
    private void Form1_Load(object sender, EventArgs e)
        foreach (RadItem item in this.radRotator1.Items)
            RadImageItem imageItem = item as RadImageItem;
            if (imageItem != null)
                LightVisualElement lve = new LightVisualElement();
                lve.Image = imageItem.Image;
                lve.ImageLayout = ImageLayout.Stretch;
                lve.ZIndex = 1000;
                lve.StretchHorizontally = true;
                lve.StretchVertically = true;

    I hope this helps. If you need further assistance, do not hesitate to ask.

    Sincerely yours,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Omair
    Omair avatar
    1 posts
    Member since:
    Oct 2010

    Posted 10 Oct 2011 Link to this post

    Dear Telerik Team

    The given code is not working in my web application, RadItem and RadImageItem is not defined classes. 
    please help, how can i stretch images in a RadRotator in web application. 

  4. Slav
    Slav avatar
    1359 posts

    Posted 13 Oct 2011 Link to this post

    Hello Omair,

    In case you want to stretch an image inside the ItemTemplate of a RadRotator according to the size of its items, please apply the CSS properties width:100% and height:100% to the image and add the following code snippet in the head section of your page:
    <style type="text/css">
        .rrClipRegion .rrItemsList .rrItem div
            width: 100%;
            height: 100%;

    For you convenience I have attached a sample page, implementing the suggested solution. You can use it as a base for your further development.

    Note that you have posted your problem in the WinForms section of the forums and you are clearly using the RadRotator for ASP.NET AJAX. Please use this section in order to report future problems and difficulties with the control.

    Best wishes,
    the Telerik team

    Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

Back to Top