Table of Contents
  • Getting Started
  • EO.Pdf
  • EO.Web
    • Overview
    • Installation & Deployement
    • EO.Web ToolTip
    • EO.Web Rating
    • EO.Web Slider & RangeSlider
    • EO.Web ListBox
    • EO.Web ComboBox
    • EO.Web Captcha
    • EO.Web ASPX To PDF
    • EO.Web Slide
    • EO.Web Flyout
    • EO.Web EditableLabel
    • EO.Web ImageZoom
    • EO.Web Floater
    • EO.Web Downloader
    • EO.Web ColorPicker
    • EO.Web HTML Editor
    • EO.Web File Explorer
    • EO.Web SpellChecker
    • EO.Web Grid
    • EO.Web MaskedEdit
    • EO.Web Splitter
    • EO.Web Menu
    • EO.Web Slide Menu
    • EO.Web TabStrip
    • EO.Web TreeView
    • EO.Web Calendar
    • EO.Web Callback
    • EO.Web MultiPage
    • EO.Web Dialog
    • EO.Web AJAXUploader
    • EO.Web ProgressBar - Free!
    • EO.Web ToolBar - Free!
  • EO.WebBrowser
  • EO.Wpf
  • Common Topics
  • Reference
Labels

Overview

EO.Web Slider/RangeSlider can display labels for any value. The following image demonstrates this feature:

Note a label does not have to correspond to a tick mark. In the above example, both label "Poor" and "Good" are between two tick marks.

Adding Labels Declaratively

You can easily declare one or more labels in .aspx. For example, the following code declares five labels:

ASPX
<eo:Slider ....>
    <Labels>
        <eo:SliderLabel Value="0" Text="Terrible" />
        <eo:SliderLabel Value="2.5" Text="Poor" />
        <eo:SliderLabel Value="5" Text="Average" />
        <eo:SliderLabel Value="7.5" Text="Good" />
        <eo:SliderLabel Value="10" Text="Pefect" />
    </Labels>
</eo:Slide>

Once declared, you can use LabelPosition property to specify whether labels should be displayed on the top/left, the bottom/right, or both sides of the slider.

Adding Labels Programmatically

The following code demonstrates how to add labels programmatically:

//Create the label
EO.SliderLabel label = new EO.SliderLabel();
label.Value = 5;
label.Text = "Average";

//Add the label to the slider's Labels collection
slider1.Labels.Add(label);

Customize Label Styles

Set LabelCssClass to customize label style. For example, the following class set the label's font and also reserves some gap space between the label text and the track bar:

.slider_label
{
    font-family: Verdana;
    font-size: 10px;
    padding-bottom: 5px;
}