This is a migrated thread and some comments may be shown as answers.

Filtering Nullable Guid Column in Grid Causes Exception

1 Answer 193 Views
Grid
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 28 Oct 2016, 05:02 PM

I have a nullable Guid column in my grid that is using an editor template to display a the text value associated with the Guid in the lookup table.

columns.ForeignKey(p => p.NotAcceptableReason, (System.Collections.IEnumerable)ViewBag.NotAcceptableReasons, "NotAcceptableReasonId", "NotAcceptableReasonName").Width(200);

 

The editor template:

@using Kendo.Mvc.UI
@model object
 
@(
 Html.Kendo().DropDownListFor(m => m)
        .BindTo((SelectList)ViewData[ViewData.TemplateInfo.GetFullHtmlFieldName("") + "_Data"])
        .OptionLabel("--- Select ---")
        .ValuePrimitive(true)
)

 

On that column's column filter popup,I get all the text values from the lookup table in a drop down list and the filtering work as expected.

However, when I try to filter the column on "Is null" or "Is not null" I get an error -> System.FormatException: Unrecognized Guid format.

I suspect this is because there is no NULL entry in the lookup table I'm binding the drop down list to.  Any suggestions for getting the "Is null" or "Is not null" column filters to work correctly in this scenario?

 

1 Answer, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 01 Nov 2016, 08:57 AM
Hi John,

I wasn't able to reproduce the mentioned issue with this online demo - http://demos.telerik.com/aspnet-mvc/grid/foreignkeycolumn. Could you please try to reproduce the problem with this demo and then send it back to us for further investigation?

You can try to download the offline demos in order to use the data source or bind some dummy to the grid. Another approach to reproduce the issue is to download some of our mvc examples (e.g., this one -  grid-foreign-key-combo-box-column)

Regards,
Danail Vasilev
Telerik by Progress
Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
Tags
Grid
Asked by
John
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
Share this question
or