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

GridViewComboBoxColumn with nullable value

2 Answers 76 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Josh Eastburn
Top achievements
Rank 1
Josh Eastburn asked on 08 Feb 2013, 04:11 PM
I am using v2012.3.1129.1050 of the Telerik Silverlight controls.
In my GridViewComboBoxColumn, my ItemsSource is a List<Assignment>:

public class Assignment
{
    public int? RecordId { get; set; }
    public string ReportLabel { get; set; }
}

I am populating the list from my RIA context, but then doing an Insert() to add an additional value with a NULL RecordId and a ReportLabel of "None Assigned".  Everything works fine with selecting and saving items from the list, but I select the NULL value, when I click away from the combobox column, the entire column goes blank instead of showing "None Assigned."

Is there a way to honor the NULL SelectedValue in the combobox column?

Thanks,
Josh

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimitrina
Telerik team
answered on 11 Feb 2013, 03:21 PM
Hi Josh,

There is not such a built-in option, but you could use a Converter for the Binding and change the value as per your requirements. Will this option work for you?

All the best,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Josh Eastburn
Top achievements
Rank 1
answered on 11 Feb 2013, 03:24 PM
Thanks, Didie.
Yes, I had considered using a converter with a -1 value but wanted to see if I was missing a way to use NULLs with the combobox.  I will go the converter route.
Thanks,
Josh
Tags
GridView
Asked by
Josh Eastburn
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Josh Eastburn
Top achievements
Rank 1
Share this question
or