# Use DropDownList and Custom DataSource to Bind to ToDataSourceResult Output

## Environment

<table>
 <tr>
  <td>Product</td>
  <td>DropDownList for Telerik UI for ASP.NET MVC</td>
 </tr>
 <tr>
  <td>Product Version</td>
  <td>Created with version 2024.4.1112</td>
 </tr>
</table>

## Description

How can I use a [custom DataSource](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/datasource/types) to bind the ASP.NET MVC DropDownList component to the [`ToDataSourceResult`](https://www.telerik.com/aspnet-mvc/documentation/api/kendo.mvc.ui/datasourceresult) output?

## Solution

You can implement this scenario using the following DropDownList definition:

```Razor HtmlHelper
@(Html.Kendo().DropDownList()
    .Name("productDropDownList")
    // The "DataTextField" and "DataValueField" options are not set, because the component is bound to an array of strings.
    .DataSource(source =>
    {
        source.Custom()
              .Type("aspnetmvc-ajax")
              .Transport(transport =>
              {
                  transport.Read("_GetData", "Home");
              })
              .Schema(schema =>
              {
                  schema.Data("Data")
                        .Total("Total");
              });
    })
)
```

To see the complete implementation, refer to the ASP.NET MVC application on how to [use a custom DataSource to bind the DropDownList to a `ToDataSourceResult` output](https://github.com/telerik/ui-for-aspnet-mvc-examples/tree/master/Telerik.Examples.Mvc/Telerik.Examples.Mvc/Areas/DropDownListCustomDataSource).

## More ASP.NET MVC DropDownList Resources

* [ASP.NET MVC DropDownList Documentation](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/editors/dropdownlist/overview)

* [ASP.NET MVC DropDownList Demos](https://demos.telerik.com/aspnet-mvc/dropdownlist)

* [ASP.NET MVC DropDownList Product Page](https://www.telerik.com/aspnet-mvc/dropdownlist)

* [Telerik UI for ASP.NET MVC Video Onboarding Course (Free for trial users and license holders)](https://www.telerik.com/aspnet-mvc/documentation/getting-started/video-onboarding)

* [Telerik UI for ASP.NET MVC Forums](https://www.telerik.com/forums/aspnet-mvc)

## See Also

* [Server-Side API Reference of the DropDownList for ASP.NET MVC](https://www.telerik.com/aspnet-mvc/documentation/api/dropdownlist)
* [Server-Side API Reference of the DataSource for ASP.NET MVC](https://www.telerik.com/aspnet-mvc/documentation/api/datasource)
