Posts Tagged ‘kendo UI’

It is pretty well documented (see below) how to use the ternary operator in Kendo Grid Column Templates, for instance to conditionally check or disable a checkbox.

I was able to get that functionality working easily, but struggled when I needed to combine both the checked and disabled attributes within a single condition expression. I could not get the syntax right and kept getting template compile runtime errors. (more…)

I have a Kendo UI grid with a variety of columns, including one that displays a calculated value for “Days Until Travel”, which is always an integer result.

One particularly thorough tester noted that when using the grid’s built-in numeric textbox filter, entered values were being displayed as decimal values, rather than integers, although the filtering was still working correctly.

This issue was not ranked as a “show stopper”, and I finally got around to looking into it today. A judicious search term brought me to this post in the Telerik forums that describes exactly how to customize the display of the filter for integer display, much to my surprise.

Like most grid customizations, the solution involves overriding the default behavior with a little bit of JavaScript, using the previously unknown (to me) UI extension to define a function that specifies a number format with zero decimal places. See the link above for the details.

I was using some ForeignKeys columns as DropDownLists in a Kendo MVC grid, and got it to work pretty easily (after reading G’s comment about creating the EditorTemplate, that is).

While editing, however, one of my values was not being posted by Edit or Create mehtods. After confirming that my code was correct and some head-scratching, a little research on Stack Overflow revealed the problem: the grid won’t bind fields whose underlying type is Nullable.

Here is the Stack Overflow post (Note: not the accepted answer) that revealed the problem, as well as a link that describes the solution in detail (see snippets 9 and 10).

Thanks to Wagar for pointing out the solution to this rather esoteric behavior.

Here is a snippet for setting up a Kendo UI DataSource for OData using the Fluent API and passing in credentials:

kendo odata

Kendo OData DataSource with Fluent API and credentials

When creating a Kendo UI grid in ASP.Net MVC, make sure that the Name property you assign the grid is not the same as the id of the container, e.g. <div> tag. The result is a  duplicate, non-functional set of paging controls at the top of the grid (and probably other problems as well).

Unwanted paging controls due to duplicate id values

Unwanted paging controls due to duplicate id values