Skip to main content

How to: Populate Item Collection Manually in Code

trackbar_example_items_range

The code sample below populates an ASPxTrackBar with items manually in code.

using DevExpress.Web.ASPxEditors;

protected void Items_Population() {
    ASPxTrackBar1.ValueType = typeof(String);
    ASPxTrackBar1.ScalePosition = DevExpress.Web.ScalePosition.Both;
    ASPxTrackBar1.AllowRangeSelection = true;
    ASPxTrackBar1.PositionStart = 0;
    ASPxTrackBar1.PositionEnd = 4;
    ASPxTrackBar1.Items.Add("Mon", "Monday");
    ASPxTrackBar1.Items.Add("Tue", "Tuesday");
    ASPxTrackBar1.Items.Add("Wed", "Wednesday");
    ASPxTrackBar1.Items.Add("Thu", "Thursday");
    ASPxTrackBar1.Items.Add("Fri", "Friday");
    ASPxTrackBar1.Items.Add("Sat", "Saturday");
    ASPxTrackBar1.Items.Add("Sun", "Sunday");
}