# Common Issues

This article provides solutions for common issues you might encounter while working with the Telerik UI Grid component for ASP.NET MVC.

## Grid Performs HTTP GET Requests instead of POST

By default, the Grid makes `POST` requests when configured for [`Ajax` data binding](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/data-management/grid/binding/ajax-binding). This is implemented by a custom DataSource transport and schema, defined in the `kendo.aspnetmvc.min.js` script file.

**Solution**: Make sure the `kendo.aspnetmvc.min.js` file is included after the `kendo.all.min.js` file. For more information, refer to the [required client-side resources article](https://www.telerik.com/aspnet-mvc/documentation/installation/adding-client-side-resources/getting-started-copy-client-resources).

The following example demonstrates the correct order of required Kendo UI script files.

```HTML _Layout.cshtml
<script src="~/Scripts/kendo-ui/js/kendo.all.min.js"></script>
<script src="~/Scripts/kendo-ui/js/kendo.aspnetmvc.min.js"></script>
```

## Ajax-Bound Grid Does Not Populate

The causes of this issue are various.

**Solution**

1. Use your browser developer console to check for any JavaScript errors. In most browsers pressing `F12` displays the developer console. Address all JavaScript errors.

2. Check the **Network**—or **Net** in Firebug—tab of the browser developer console. Look for a failed HTTP request for the action method configured via the `DataSource` Grid setting.

   * HTTP status code [401](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#401) indicates that the required authentication has failed or has not been provided yet.
   * HTTP status code [403](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#403) indicates that the request is not authorized. Perhaps the current user does not have the required permissions.
   * HTTP status code [404](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#404) indicates that the requested URL cannot be found. Check if the controller and action names are spelled correctly.
   * HTTP status code [500](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#500) indicates that a server error occurred while processing the request. Check what the server response is. In most cases, it will contain the full `.NET` stacktrace. If the reason for the exception is not clear, put a break-point in the action method and break with the debugger. Also, refer to the [article on well-known exceptions](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/data-management/grid/troubleshoot/known-exceptions).

3. Check if you are using the `ToDataSourceResult` extension method. That method returns the data in the JSON format expected by the Grid.

## Client-Side Events Are Not Raised in Server-Bound Mode

When configured for server-binding, the Grid for ASP.NET MVC does not fire all [client-side events](https://www.telerik.com/aspnet-mvc/documentation/api/kendo.mvc.ui.fluent/grideventbuilder).

For more information on how to resolve this issue, refer to the [server-binding Grid documentation](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/data-management/grid/binding/server-binding#supported-client-side-events).

For an `Ajax` bound Grid, make sure the `ServerOperation(false)` property of the DataSource is set.

## Grid Fails to Update Dates and Numbers When Current Culture Is Not en-US

Make sure the respective culture script file is included (for example, `kendo.culture.es-ES.min.js`). For more information, refer to the [globalization documentation](https://www.telerik.com/aspnet-mvc/documentation/globalization/overview#applying-cultures).

## Column Templates Are Not Displayed

* Case 1—The column template is not displayed if the server template is set, but the Grid is configured for [`Ajax` binding](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/data-management/grid/binding/ajax-binding).

  **Solution**: Set the `ClientTemplate` option, as well.

* Case 2—The column template is not displayed if only the client template is set, but the Grid is configured for [server-binding](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/data-management/grid/binding/server-binding).

  **Solution**: Set the `Template` option, as well.

## "X" DataSource Configuration Option Is Not Available

Not all settings of the DataSource are exposed through the `DataSource` fluent API.

**Solution**: To gain full control over the DataSource, consider using the [`Custom()`](https://demos.telerik.com/aspnet-mvc/grid/custom-datasource) fluent API.

## Grid Fires Create Action instead of Update Action

If an `ID` value is not specified for a given data item, the DataSource of the Grid treats it as a new data item and calls the `Create` action.

**Solution**: Define the `Id` option in the `Model()` configuration of the DataSource to ensure the Create, Update, and Destroy operations work correctly. The specified `Id` field acts as an identifier of the Model.

```Razor HtmlHelper
@(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.ProductViewModel>()    
    .Name("grid")    
    ... // Additional configuration.
    .DataSource(dataSource => dataSource        
        .Ajax()         
        .Model(model => model.Id(p => p.ProductID))
        ...
    )
)
```

## Grid Does Not Display Numbers and Dates in the Correct Culture Format

By default, the Grid formats dates and numbers using the `en-US` culture.

If the Grid does not display the numbers and dates in a format that matches the server-side culture of the application, update the client-side culture to match the server-side culture, as described in the [globalization documentation](https://www.telerik.com/aspnet-mvc/documentation/globalization/overview#matching-cultures).

## See Also

* [Basic Usage of the Grid HtmlHelper for ASP.NET MVC (Demo)](https://demos.telerik.com/aspnet-mvc/grid)
* [Using the API of the Grid HtmlHelper for ASP.NET MVC (Demo)](https://demos.telerik.com/aspnet-mvc/grid/api)
* [Server-Side API](https://www.telerik.com/aspnet-mvc/documentation/api/grid)
