Skip to main content

TrackBarSettings.Position Property

Gets or sets the current drag handle position.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v23.2.dll

NuGet Package: DevExpress.Web.Mvc5

Declaration

public decimal Position { get; set; }

Property Value

Type Description
Decimal

A Decimal value that specifies the drag handle position.

Remarks

The Position property allows you to identify where a drag handle is placed.

If the TrackBarProperties.Items collection is specified, the Position property returns a zero-based index of an item where the drag handle is placed. If the Items collection is empty, the Position property is equal to the item’s TrackBarItem.Value property.

The available range of values of the Position property is determined by the TrackBarProperties.MinValue and TrackBarProperties.MaxValue property values.

When the TrackBarProperties.AllowRangeSelection is set to true a TrackBar displays two drag handles to support the value range selection. In this case, use the TrackBarSettings.PositionStart and TrackBarSettings.PositionEnd properties to specify positions of main and secondary drag handles respectively.

Example

View code (Razor):

@Html.DevExpress().TrackBar(
     settings => {
          settings.Name = "myTrackBar";
          settings.Properties.SmallTickFrequency = 5;
          settings.Properties.LargeTickInterval = 10;
          settings.Properties.MaxValue = 50;
          settings.Position = 10;
          settings.Properties.ScalePosition = ScalePosition.RightOrBottom;
     }
).GetHtml()
See Also