[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Collapse]Editors and Simple Controls
    Included Controls and Components
   [Expand]Common Editor Features and Concepts
   [Expand]Lookup Editors
    Popup Container Editor
   [Expand]Token Edit Control
   [Expand]Breadcrumb Edit Control
   [Collapse]Range Control
     Visual Elements
     Numeric Ranges
     Custom Range Control Client
   [Expand]Image Slider
    Camera Control
    Templated ListBox Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Gantt Control
  [Expand]Chart Control
  [Expand]Map Control
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Numeric Ranges

The Range Control's data visualization specifics are covered in the Range Control topic. The current document shows how to set up a Range Control to display numeric ranges and allow end-users to select them.

The Range Control provides a drawing surface where a Range Control Client visualizes its data. To add support for numeric (integer, float, double or decimal) ranges, you need to assign a NumericRangeControlClient object to the RangeControl.Client property.

Expanded Design-Time Example

  1. Drop a RangeControl control from the Toolbox onto the form.

    No Range Control Client is added to the Range Control at the moment. A message is displayed across the control prompting you to add a Client.

  2. Right click the Range Control and select Add Numeric Client.

    This adds a NumericRangeControlClient to the form and assigns it to the RangeControl.Client property.

  3. Once the Numeric Range Control Client is added, the Range Control displays a ruler, tickmark lines and selection thumbs.

    You can now run the application and see the Range Control in action.

  4. After adding a NumericRangeControlClient, its settings become accessible via the RangeControl.ClientOptions property. You can use this property to customize the available options.

    A numeric range is limited by its NumericRangeControlClient.Minimum and NumericRangeControlClient.Maximum values. The NumericRangeControlClient.RulerDelta property specifies the minimum distance between tickmarks and also defines the minimum step for range selection.

  5. By default, the NumericRangeControlClient.Minimum, NumericRangeControlClient.Maximum and NumericRangeControlClient.RulerDelta property values are of the integer type. To display a range of the double, decimal or float type, you need to set these properties to the required double, decimal or float values.

    Here is how you can set the Maximum property to the double 10.5 value. Focus the Maximum member in the Properties window and click the ellipsis button.

    In the Object Editor window, set Type to Numeric(Double) and Value to 10.5.

    The result of setting the Maximum, Minimum and RulerDelta properties to the double values 10.5, 5.5 and 0.5 respectively is shown below.

The currently selected range can be obtained via the RangeControl.SelectedRange property. You can also use this property to change the selected range from code.

Expanded Runtime Example

The following code shows how to set up a NumericRangeControlClient to select a range of the double type between 5.5 and 10.5, with the minimum step set to 0.5.

The result is displayed below.

Is this topic helpful?​​​​​​​