# Build the Team Efficiency Dashboard Project

## Step 2: Input Controls

In this chapter you'll learn how to add Kendo UI widgets to your application. UI for MVC has powerful HTML Helpers that configure and render Kendo UI widgets.

### Kendo UI Helper Overview

#### Server-Side Wrappers

Telerik UI for ASP.NET MVC is a set of server-side wrappers. A server-wrapper does the following:

* Allows the developer to configure a Kendo UI widget via C# or VB.NET code—set its value, data source, etc.
* Renders the HTML and JavaScript needed to initialize the Kendo UI widget. The widget options propagate to the client side via the widget initialization script.

![UI for ASP.NET MVC Server-side wrapper outputs HTML and JavaScript](https://www.telerik.com/aspnet-mvc/documentation/assets/0010b89f5c288ebcc4189738389cf54f/wrapper-output.png)

#### Configuration

The Kendo UI HtmlHelper exposes all Kendo UI server wrappers.

![UI for ASP.NET MVC HtmlHelper extension method](https://www.telerik.com/aspnet-mvc/documentation/assets/69bf8291b1b344fbb0364c4f0e3b258b/kendo-extension.png)

#### Widget Options

The widget options are exposed via a fluent interface.

![UI for ASP.NET MVC Fluent interface](https://www.telerik.com/aspnet-mvc/documentation/assets/87f811d4f19eccfffd1924c5ed352352/fluent-interface.png)

Below is an example of how a NumericTextBox input is created.

```
@(Html.Kendo().NumericTextBox()
    .Name("age") // set the name of the NumericTextBox
    .Value(10) //set the value
    .Spinners(false) // disable the spinners
)
```

### Adding a Kendo UI DatePicker

#### Overview

Let's open the `Index.cshtml` page under the folder `~\Views\Home\`. The `Index.cshtml` page is where most of the application's UI lives. This page currently contains basic HTML inputs to collect date input from the user. To provide a better user experience, replace the standard HTML inputs with Kendo UI date picker controls. The Kendo UI date picker controls offer users a flyout calendar to choose a desired date.

> The Kendo UI DatePicker control is touch and mouse friendly. No additional code is necessary to support tablets and phones.

#### Exercise: Replace StatsFrom and StatsTo TextBoxes with Kendo UI Date Pickers

1. Open `~\Views\Home\Index.cshtml` and find the `StatsFrom` text box helper.

   ```
    
    @Html.TextBox("StatsFrom", new DateTime(1996, 1, 1))
   ```

2. Replace the text box helper with a Kendo UI date picker. Set the `Name` property to `StatsFrom` and the `Value` with a new `DateTime` of `1996,1,1`.

   ```
    
    @(Html.Kendo().DatePicker()
           .Name("StatsFrom")
           .Value(new DateTime(1996, 1, 1))
    )
   ```

3. Find the `StatsTo` text box helper.

   ```
    
    @Html.TextBox("StatsTo", new DateTime(1996, 1, 1))
   ```

4. Replace the text box helper with a Kendo UI DatePicker. Set the `Name` property to `StatsTo` and the `Value` with a new `DateTime` of `1998,8,1`.

   ```
    
    @(Html.Kendo().DatePicker()
    		.Name("StatsTo")
    		.Value(new DateTime(1998, 8, 1))
    )
   ```

The Kendo UI HTML helper's fluent interface lets you configure a widget's behavior and appearance. The code you just added uses the following properties:

* `Name`—The property sets the rendered HTML element's id property.
* `Value`—Sets a default selected date value for the date picker.

After you run your app with this change, you will see a calendar icon in the **Stats from** field. Click or tap the icon to reveal the date picker.

![UI for ASP.NET MVC Tap to show a DatePicker](https://www.telerik.com/aspnet-mvc/documentation/assets/8039daae2643002ba5f095ea7a136f44/date-picker-flyout.png)

With the inputs upgraded, let's move on to the extremely robust Kendo UI Grid.
