LinearGauge HtmlHelper Overview
The LinearGauge HtmlHelper extension is a server-side wrapper for the Kendo LinearGauge widget.
Getting Started
Configuration
Below are listed the steps for you to follow when configuring the Kendo UI LinearGauge.
Make sure you followed all the steps from the introductory article on Telerik UI for ASP.NET MVC.
-
Create a new action method which renders the view.
Example
public ActionResult Index() { return View(); }
-
Add a LinearGauge.
<%: Html.Kendo().LinearGauge() .Name("linearGauge") //The name of the LinearGauge is mandatory. It specifies the "id" attribute of the widget. .Scale(scale => scale .Min(0) //Set the min value of the LinearGauge. .Max(200) //Set the min value of the LinearGauge. ) .Pointer(pointer => pointer .Value(10) //Set the value of the LinearGauge. ) %>
@(Html.Kendo().LinearGauge() .Name("linearGauge") //The name of the LinearGauge is mandatory. It specifies the "id" attribute of the widget. .Scale(scale => scale .Min(0) //Set the min value of the LinearGauge. .Max(200) //Set the min value of the LinearGauge. ) .Pointer(pointer => pointer .Value(10) //Set the value of the LinearGauge. ) )
Reference
Existing Instances
To reference an existing Kendo UI LinearGauge instance, use the jQuery.data()
configuration option. Once a reference is established, use the LinearGauge API to control its behavior.
Example
//Put this after your Kendo UI LinearGauge for ASP.NET MVC declaration.
<script>
$(function() {
//Notice that the Name() of the LinearGauge is used to get its client-side instance.
var gauge = $("#linearGauge").data("kendoLinearGauge");
});
</script>
See Also
- Telerik UI for ASP.NET MVC API Reference: LinearGaugeBuilder
- Overview of Telerik UI for ASP.NET MVC
- Fundamentals of Telerik UI for ASP.NET MVC
- Scaffolding in Telerik UI for ASP.NET MVC
- Overview of the Kendo UI LinearGauge Widget
- Telerik UI for ASP.NET MVC API Reference Folder
- Telerik UI for ASP.NET MVC HtmlHelpers Folder
- Tutorials on Telerik UI for ASP.NET MVC
- Telerik UI for ASP.NET MVC Troubleshooting