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?