This is a migrated thread and some comments may be shown as answers.

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

1 Answer 23 Views
Rotator
This is a migrated thread and some comments may be shown as answers.
Prava kafle
Top achievements
Rank 1
Prava kafle asked on 27 Dec 2012, 06:59 PM
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

1 Answer, 1 is accepted

Sort by
0
Slav
Telerik team
answered on 02 Jan 2013, 03:40 PM
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.
Tags
Rotator
Asked by
Prava kafle
Top achievements
Rank 1
Answers by
Slav
Telerik team
Share this question
or