GridViewComboBoxColumn not displaying the value when binding RadGridView to Datable.DefaultView

2 posts, 0 answers
  1. Rathish
    Rathish avatar
    1 posts
    Member since:
    Jul 2015

    Posted 17 Jul 2015 Link to this post

    In the below attached Code Snippet, ​While trying to generate a gridview dynamically , I was not able to bind the values of Datable to to Combox Column.

    I have tried populating combox items but when I select a Value its saving back to the Datatable.

    Please help me out to bind the Datable Value to Combo box selected value and save the new item selected from the combox list back to the Datatable



    this.ItemsGrid.ItemsSource = this.Datable1.DefaultView;
    List<LOV> lovs = new List<LOV>();
    lovs.Add(new LOV { Id= "1", Value = "test1" });
    lovs.Add(new LOV { Id= "2", Value = "​test2" });
    lovs.Add(new LOV { Id= "3", Value = "​test3" });
    lovs.Add(new LOV { Id= "4", Value = "​test4" });
    lovs.Add(new LOV { Id= "5", Value = "test5" });

    foreach ( Car cr in Cars)
    switch (cr.CONTROL_TYPE.ToUpper())
    case "COMBOBOX":
    Telerik.Windows.Controls.GridViewComboBoxColumn comboBoxColumn = new Telerik.Windows.Controls.GridViewComboBoxColumn();                       comboBoxColumn.DataMemberBinding = new Binding(cr.Name);
    comboBoxColumn.ItemsSource = lovs;
    comboBoxColumn.DisplayMemberPath = "Value";
    comboBoxColumn.SelectedValueMemberPath = "Id";
    comboBoxColumn.Header = cr.Name;

    case "TEXTBOX":
    Telerik.Windows.Controls.GridViewDataColumn txtBoxColumn = new Telerik.Windows.Controls.GridViewDataColumn();
    txtBoxColumn.DataMemberBinding = new Binding(cr.Name);
    txtBoxColumn.Header = cr.Name;

    case "CHECKBOX":
    Telerik.Windows.Controls.GridViewCheckBoxColumn chkBoxColumn = new Telerik.Windows.Controls.GridViewCheckBoxColumn();
    chkBoxColumn.DataMemberBinding = new Binding(cr.Name);
    chkBoxColumn.Header = cr.Name;


    public class LOV
    public string Id {get;set;}
    public string Value{get;set;}

  2. Dimitrina
    Dimitrina avatar
    3769 posts

    Posted 20 Jul 2015 Link to this post


    Does value cr.Name (comboBoxColumn.DataMemberBinding) correspond to value LOV.Id (comboBoxColumn.SelectedValueMemberPath)? You can also refer to the documentation on how to configure and work with ComboBox Column.

    There is also a problem troubleshooted at this online article.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft R3 2016 release webinar banner
Back to Top