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

RadRotator Server Side

1 Answer 84 Views
Rotator
This is a migrated thread and some comments may be shown as answers.
Dick
Top achievements
Rank 1
Dick asked on 02 Oct 2009, 01:22 PM

I add a RadRotator to my page control collection dynamically. I create a new itemTemplate and assign a datasource.


DataTable
dataTable = GetDataSetFromXml().Tables[0];

 

RadRotator1.ItemTemplate = new RotatorItemTemplate();

RadRotator1.DataSource = dataTable;

RadRotator1.DataBind();

RadRotator1.ScrollDirection = RotatorScrollDirection.Up.  

....

private class RotatorItemTemplate : ITemplate

 

{

Label literal;

public void InstantiateIn(Control container)

{

literal = new Label();

literal.DataBinding += literal_DataBinding;

container.Controls.Add(literal);

}

static void literal_DataBinding(object sender, EventArgs e)

{

Label labelControl = (Label)sender;

RadRotatorItem rotatorItem = (RadRotatorItem)labelControl.NamingContainer;

string html = (string)((DataRowView)rotatorItem.DataItem)["Html"];

labelControl.Text = "<table cellpadding=\"0\" cellspacing=\"1\"><tr><td>" + html + "</td></tr></table>";

}

}

When i run my project the rotator shows all the rotatoritems side by side; the rotator doen't scroll.
The RadScriptManagers is included in the page.

Can anyone help me solve this problem?

1 Answer, 1 is accepted

Sort by
0
Fiko
Telerik team
answered on 06 Oct 2009, 04:46 PM
Hello Dick,

I believe that this Blog post will be of help.

Greetings,
Fiko
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Rotator
Asked by
Dick
Top achievements
Rank 1
Answers by
Fiko
Telerik team
Share this question
or