# Local Binding

Local data binding refers to binding the DropDownList component to a dataset that is prepared on the server and made available during the initial page rendering. The data is retrieved server-side (from a database, service, or other data source) and then passed to the view, where the `BindTo()` method accepts the `IEnumerable` collection.

The local data binding approach is often used when dealing with small to medium-sized datasets since all records are available when the page is loaded. Also, when the client-side filtering of the DropDownList is enabled and the complete dataset can be accessed on the client, no additional server requests are needed, which provides fast and responsive user interactions. However, for large datasets, consider using [Ajax data binding](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/editors/dropdownlist/binding/ajax-binding) to avoid increased initial page load times and memory usage.

To configure the DropDownList for local data binding, follow the next steps:

1. Create a new action method and pass the **Products** table as the model.

```C#
public ActionResult Index()
{
        NorthwindDataContext northwind = new NorthwindDataContext();
        return View(northwind.Products);
}
```

2. Define the DropDownList and bind it to the model collection available in the view.

```Razor HtmlHelper
@model IEnumerable<MvcApplication1.Models.Product>

@(Html.Kendo().DropDownList()
        .Name("productDropDownList") // The name of the DropDownList is mandatory. It specifies the "id" attribute of the HTML element of the component.
        .DataTextField("ProductName") // Specify the property of the "Product" model that must be used as an option text.
        .DataValueField("ProductID") // Specify the property of the "Product" model that must be used as an option value.
        .BindTo(Model) // Pass the list of Products to the DropDownList.
)
```

## See Also

* [Basic Usage of the DropDownList for ASP.NET MVC (Demo)](https://demos.telerik.com/aspnet-mvc/dropdownlist/basic-usage)
* [Ajax Data Binding](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/editors/dropdownlist/binding/ajax-binding)
* [Server-Side API of the DropDownList HtmlHelper](https://www.telerik.com/aspnet-mvc/documentation/api/dropdownlist)
