LinearGauge
Editing Values
This example demonstrates how to use the IsReadOnly and Step properties with the LinearGauge control.
Features
Settings
Is Read Only: False
Step: 0.5
Show Ticks: False
Show Tick Text: False
Handle Wheel: True
Description
This example demonstrates how to use the IsReadOnly and Step properties with the LinearGauge control.
ShowTicks: determines whether the gauge should display tickmarks at each step or tickSpacing value.
ShowTickText: determines whether the gauge should display the text value of each tick mark.
HandleWheel: determines whether the user can edit the gauge value using the mouse wheel.
ShowTicks: determines whether the gauge should display tickmarks at each step or tickSpacing value.
ShowTickText: determines whether the gauge should display the text value of each tick mark.
HandleWheel: determines whether the user can edit the gauge value using the mouse wheel.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | using MvcExplorer.Models; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace MvcExplorer.Controllers { public partial class LinearGaugeController : Controller { public ActionResult Editing() { ViewBag.DemoSettings = true ; ViewBag.DemoSettingsModel = new ClientSettingsModel { Settings = CreateEditingSettings() }; return View(); } private static IDictionary< string , object []> CreateEditingSettings() { var settings = new Dictionary< string , object []> { { "IsReadOnly" , new object []{ false , true }}, { "Step" , new object []{0.5, 1, 2}}, { "ShowTicks" , new object []{ false , true }}, { "ShowTickText" , new object []{ false , true }}, { "HandleWheel" , new object []{ true , false }}, }; return settings; } } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | @ { ClientSettingsModel demoSettingsModel = ViewBag.DemoSettingsModel; } @section Styles{ < style > .wj-gauge .wj-tick-text text { opacity: 1; font-family: Courier; font-size: 8pt; fill: purple; } </ style > } < br /> @ (Html.C1().LinearGauge().Id(demoSettingsModel.ControlId) .Min(0).Max(10).Value(5).Format( "" ).ShowText(ShowText.All) .IsReadOnly( false ).Step(0.5).Width(500) .ShowTicks( false ).ShowTickText( false ) .HandleWheel( true ) ) @section Description{ @Html .Raw(Resources.LinearGauge.Editing_Text0) < br /> @Html .Raw(Resources.LinearGauge.Editing_Text1) < br /> @Html .Raw(Resources.LinearGauge.Editing_Text2) < br /> @Html .Raw(Resources.LinearGauge.Editing_Text3) } |