Orientation
8 Aug 20171 minute to read
The Rotator control supports both vertical and horizontal orientations allowing it to fit into any scenario. The Orientation property defines the Orientation where the control is rendered. The value set to this property is enum or string type. It accepts the following values.
- ej.Orientation.Horizontal or “Horizontal”
- ej.Orientation.Vertical or “Vertical”
The following steps explain you how to set Orientation for the Rotator.
Horizontal
This property sets the Rotator in HorizontalOrientation. You can refer the following steps to set Horizontal Orientation for Rotator control. In Rotator control, the Default value of Orientation is Horizontal.
- In View, create ul-li list of Rotator items and invoke the Rotator helper.
- Add the following script in your CSHTML page.
// Add this code in your CSHTML page and refer local data section for binding Rotator items.
@Html.EJ().Rotator("sliderContent").Datasource((IEnumerable<LocalData>)ViewBag.datasource)
.RotatorFields(t => t.Text("Text").Url("Url"))
.SlideWidth("600px")
.SlideHeight("350px")
.Orientation(Syncfusion.JavaScript.Orientation.Horizontal)
Vertical
This property sets the Rotator in vertical orientation. You can refer the following steps to set VerticalOrientation for Rotator control.
- Create ul-li list of Rotator items and invoke the Rotator helper.
- Add the following script in your CSHTML page.
// Add this code in your CSHTML page and refer local data section for binding Rotator items.
@Html.EJ().Rotator("sliderContent").Datasource((IEnumerable<LocalData>)ViewBag.datasource)
.RotatorFields(t => t.Text("Text").Url("Url"))
.SlideWidth("600px").SlideHeight("350px")
.Orientation(Syncfusion.JavaScript.Orientation.Vertical)