Posts Tagged ‘Data Binding’

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.

After way too much pain trying to figure this out, it looks like the following is the correct syntax for setting up a FormatString specification in a Silverlight 5 XAML data binding statement:

‘{}{format string}’

(more…)

I was experimenting with a DataGrid that was bound to a list via XAML, where I set up the columns (to apply custom templates) and bound them individually to the properties of the typed objects in the list.

Everything worked as desired, until I tried to add a manually calculated value to an unbound column I added to the XAML. This caused some sort of exception and resulted in a blank UI in the page.

Maybe it is possible to do this by handling the exception, but I just modified the list generation code and added data binding for the new column, so that was a simple enough solution in this case.