Binding to Remote Data

Remote data binding enables you to bind the Menu to a server end-point that returns the items collection for the Menu.

The Menu supports remote data binding as of the R2 2019 release.

```
public JsonResult GetCategories()
{
    SampleEntities northwind = new SampleEntities();

    var result = northwind.Categories.Select((category) =>
        new
        {
            Name = category.CategoryName,
            Products = northwind.Products
                .Where((product) => product.CategoryID == category.CategoryID)
                .Select((product)=> new { Name = product.ProductName })
        }
    );

    return Json(result, JsonRequestBehavior.AllowGet);
}
```

```ASPX
    <%: Html.Kendo().Menu()
        .Name("menu")
        .DataTextField("Name")
        .DataSource(dataSource => dataSource
            .Model(model => model.Children("Products"))
            .Read(read => read
                .Action("GetCategories", "Menu")
            )
        )
    %>
```
```Razor
    @(Html.Kendo().Menu()
        .Name("menu")
        .DataTextField("Name")
        .DataSource(dataSource => dataSource
            .Model(model => model.Children("Products"))
            .Read(read => read
                .Action("GetCategories", "Menu")
            )
        )
    )
```

See Also

In this article
Not finding the help you need? Improve this article