Your search did not match any results.

Custom Formatting

Documentation

This demo demonstrates the ability of the RangeSelector to set a custom format. The format of the slider marker is customized via the customizeText callback. The scale data is also formatted since the initial precision set in the data source is not suitable for properly displaying the data. So, a more appropriate precision is set for scale labels.

Backend API
@(Html.DevExtreme().RangeSelector() .ID("range-selector") .Margin(m => m.Top(50)) .Scale(s => s .MinorTickInterval(0.001) .TickInterval(0.005) .StartValue(0.004563) .EndValue(0.04976) .Label(l => l.Format(f => f .Type(Format.FixedPoint) .Precision(3) )) ) .SliderMarker(sm => sm .Format(f => f .Type(Format.FixedPoint) .Precision(4) ) .CustomizeText(@<text> function() { return this.valueText + " mg/L"; } </text>) ) .Behavior(b => b.SnapToTicks(true)) .Title("Select a Lead Concentration in Water") )
using DevExtreme.AspNet.Data; using DevExtreme.AspNet.Mvc; using DevExtreme.MVC.Demos.Models.SampleData; using System.Linq; using System.Web.Mvc; namespace DevExtreme.MVC.Demos.Controllers { public class RangeSelectorController : Controller { public ActionResult CustomFormatting() { return View(); } } }
#range-selector { height: 210px; }