GridViewComboBoxColumn with nullable value

3 posts, 1 answers
  1. Josh Eastburn
    Josh Eastburn avatar
    32 posts
    Member since:
    Aug 2012

    Posted 08 Feb 2013 Link to this post

    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. Answer
    Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 11 Feb 2013 Link to this post

    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.

  3. Josh Eastburn
    Josh Eastburn avatar
    32 posts
    Member since:
    Aug 2012

    Posted 11 Feb 2013 Link to this post

    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
Back to Top