Rotator to display one big string, with characters added from right of string and deleted from left of screen

2 posts, 0 answers
  1. Prava kafle
    Prava kafle avatar
    212 posts
    Member since:
    Apr 2010

    Posted 27 Dec 2012 Link to this post

    Hi,

    I have one bring string and I would like my text to move  one word at a time to  the left of screen and load new character on right of screen at the same time.  Can you provide some sample code for this?

    Thanks,
    Prava
  2. Slav
    Admin
    Slav avatar
    1356 posts

    Posted 02 Jan 2013 Link to this post

    Hi Prava,

    If I understand you correctly, you want to split a particular string on portions and use them to populate a RadRotator. Note that the size of all rotator items should be the same, so you will need to split your text equally. After this is done, you should be able to data-bind the rotator similarly to the following sample:
    <telerik:RadRotator runat="server" ID="WordsRotator" Width="450px" Height="30px"
        ItemHeight="30px" ItemWidth="150px">
        <ItemTemplate>
            <%# Container.DataItem %>
        </ItemTemplate>
    </telerik:RadRotator>

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            WordsRotator.DataSource = new string[] { "This is a sample text 1", "This is a sample text 2", "This is a sample text 3", "This is a sample text 4" };
            WordsRotator.DataBind();
        }
    }

    I hope this helps. Feel free to contact us again if you encounter more difficulties.

    Greetings,
    Slav
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top