GridViewComboBoxColumn Not Displaying Selected Value

8 posts, 1 answers
  1. Corey
    Corey avatar
    26 posts
    Member since:
    Nov 2012

    Posted 16 Jan 2013 Link to this post


                    I’m having some issues with a GridViewComboBoxColumn.  I am binding a List of items to populate the combo box.  My overall data structure is as follows.  My grid’s ItemsSource is a List of ActionListInfo items.  Each ActionListInfo contains:  string ActionName, int SequenceNumber, DrillDownSource DDSource, List<DrillDownSource> PossibleSources.  Each instance of DrillDownSource contains:  int Id, string Name.  Note that the list of PossibleSources is different between each ActionListInfo and can change dynamically.

                    My grid consists of a column displaying each ActionListInfo’s name, a column displaying their sequence #, and their selected DrillDownSource (the combo box column).  First off, the combo box does not display anything until it is clicked.  The combo box then correctly displays the possible options for that row’s DrillDownSource.  Selecting one of these choices correctly fires the DDSource_Changed listener and even sets the DDSource of that row’s ActionListInfo properly (I know this because I’ve added a test column that is bound to each ActionListInfo’s DDSource property and it updates correctly after selecting a choice).

                    The problem I’m having is that even after a selection is made, once the user clicks away from the combo box (leaving edit mode I suppose), the cell goes blank.  I know the value was selected, but no value is displayed in the comb box cell.  It’s just empty.  It’s worth noting that when my listener DDSource_Changed is called, it does its own rebinding of the grid.  It clears the grid’s ItemsSource and then sets it to the list of ActionListInfo items (one of which has a newly defined DDSource).  Please look at the included pictures in order to better understand.

                    Is there any way to set the SelectedValue property of the combo box in the column?  I would like to set it to the DDSource of each ActionListInfo (this DDSource is updated correctly each time the combo box is used).  If not, please tell me what I might be doing wrong.  Is there a specific binding similar to SelectedValueMemberPath that is used to determine which choice to display?  My binding for this particular column is shown below.

    Please note that I do all of my work in the code.  I do not use any XAML.  Also, sorry for the wall of text.


    GridViewComboBoxColumn ddSource = new GridViewComboBoxColumn();

    ddSource.ItemsSourceBinding = new System.Windows.Data.Binding("PossibleSources");

    ddSource.DataMemberBinding = new System.Windows.Data.Binding("Id");

    ddSource.Header = "Drill-Down Source";

    ddSource.DisplayMemberPath = "Name";

    ddSource.SelectedValueMemberPath = "Id";

    ddSource.IsReadOnly = false;

    ddSource.EditTriggers = Telerik.Windows.Controls.GridView.GridViewEditTriggers.CellClick;


    _grid.AddHandler(RadComboBox.SelectionChangedEvent, new Telerik.Windows.Controls.SelectionChangedEventHandler(DDSource_Changed));

    _grid.ItemsSource = _actions;

  2. Answer
    Yoan avatar
    1051 posts

    Posted 21 Jan 2013 Link to this post

    Hello Corey,

    I have tested your scenario, using the code snippet you provided, but I was not able to reproduce this problem. For you convenience, I have attached a sample project. Would it be possible to modify it in order to reproduce the problem and resend it back to me ?

    Moreover, I can suggest you check this help article, where you can find a detailed information about the GridViewComboBoxColumn.

    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. Corey
    Corey avatar
    26 posts
    Member since:
    Nov 2012

    Posted 21 Jan 2013 Link to this post

    My apologies.  I had determined the reason for my problem but forgot to update this post.  Thank you for your reply.

    My problem was solely with the binding and my understanding (or lack thereof) as to how it worked.  I had incorrectly setup the DataMemberBinding for the column.  I was trying to set it to the ID property of the DrillDownSource class used to populate the combo box.  What I needed to do was to set the DataMemberBinding to a property of the grid's ItemsSource class (I called the property SelectedDrillDownSource).  This is what ultimately sets the appropriate binding for the selected value of the combo box and now my combo box column is working as intended.  It populates, selects, displays, and updates correctly.
  5. Rodro
    Rodro avatar
    9 posts
    Member since:
    Jun 2012

    Posted 22 Jan 2013 Link to this post


    I'm experiencing the same kind of problem, GridViewComboBoxColumn is not displaying the selected value in "view mode" although the edit mode works ok.

    Interestingly, when a cell in that column is in edit mode all the other cells in the same column would display the correct value in view-mode, but as soon as I tab out the whole column gets cleared (although the selected values would stay in place).

    I'm using the Binaries.NoXaml assemblies with default Windows8 theme files and I suspect that there is a bug in this flavor of the theme, as it happened before...

    Or am I missing something obvious?

    Version is 2012.3.1017.1050

    I'm attaching two screenshots to prove what I say.

    Here is my (reduced) xaml:
    <telerik:RadGridView Grid.Row="1"
                               ItemsSource="{Binding Path=Columns, Mode=OneWay}"
                               SelectedItem="{Binding Path=SelectedColumn, Mode=TwoWay}">
              <telerik:GridViewDataColumn Header="Posizione" UniqueName="Position" EditorStyle="{StaticResource gridTextEditorStyle}" DataMemberBinding="{Binding Path=Position, Mode=OneWay}" IsReadOnly="True"/>
              <telerik:GridViewMaskedTextBoxColumn Header="Dimensione" UniqueName="Length" EditorStyle="{StaticResource gridMaskedTextEditorStyle}" MaskType="Standard" Mask="####" DataMemberBinding="{Binding Path=Length, Mode=TwoWay}"/>
              <telerik:GridViewDataColumn Header="Nome" UniqueName="Name" EditorStyle="{StaticResource gridTextEditorStyle}" DataMemberBinding="{Binding Path=Name, Mode=TwoWay, ValidatesOnDataErrors=True}" ValidatesOnDataErrors="None"/>
              <telerik:GridViewComboBoxColumn  Header="Tipo" UniqueName="DataType" EditorStyle="{StaticResource gridComboEditorStyle}" ItemsSource="{Binding Path=DataTypes, Mode=OneTime}" SelectedValueMemberPath="Value" DisplayMemberPath="Key" DataMemberBinding="{Binding Path=DataType, Mode=TwoWay}" IsComboBoxEditable="False"  />
              <telerik:GridViewComboBoxColumn  Header="Allineamento" UniqueName="Alignment" EditorStyle="{StaticResource gridComboEditorStyle}" ItemsSource="{Binding Path=Alignments, Mode=OneTime}" SelectedValueMemberPath="Value" DisplayMemberPath="DisplayText" DataMemberBinding="{Binding Path=Alignment, Mode=TwoWay}"  IsComboBoxEditable="False"/>
              <telerik:GridViewDataColumn Header="Riempimento" UniqueName="Padding" EditorStyle="{StaticResource gridTextEditorStyle}" DataMemberBinding="{Binding Path=Padding, Mode=TwoWay}"/>
              <telerik:GridViewDataColumn Header="Formattazione" UniqueName="FormatString" EditorStyle="{StaticResource gridTextEditorStyle}" DataMemberBinding="{Binding Path=FormatString, Mode=TwoWay}" />

    Note that the editor style is just clearing any default margin and border thickness, nothing else.

    The itemsSource is a Dictionary<string,Type> I use to present the user with friendly type names.
    The "DataType" member on my item is of type "Type".

    Please Help!


  6. Yoan
    Yoan avatar
    1051 posts

    Posted 24 Jan 2013 Link to this post

    Hi Rodrigo,

    I can suggest you to run through this troubleshooting article for a reference.

    Please, let me know if you need further assistance on this.

    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  7. Muhammad Owais
    Muhammad Owais avatar
    2 posts
    Member since:
    Jul 2015

    Posted 30 Jul 2015 in reply to Yoan Link to this post

    Hi Yoan,

    I am very new to telerik therefore apologies in advance. I am facing the same issue. I have even went through yet couldn't solve the problem.


    My model is as follows :

     public class Role
            public int pkOperatorRoleId { get; set; }
            public string Description
            { get; set; }

     public class OperatorModel

            public int PkOperatorDetailId { get; set; }
            public int RoleId { get; set; }

            public string UserName
            { get; set; }

            public string Name

    MainPage.Xaml : 

    <telerik:GridViewComboBoxColumn UniqueName="Role"  DataMemberBinding="{Binding pkOperatorRoleId, Mode=TwoWay}"  SelectedValueMemberPath="RoleId" DisplayMemberPath="Description" Width="*" Header="Role"></telerik:GridViewComboBoxColumn>

     MainPage.cs :

     ObservableCollection<Role> itemSourceRole;

    void client_GetRoleCompleted(object sender, GetRoleCompletedEventArgs e)
                itemSourceRole = e.Result;

                ((GridViewComboBoxColumn)this.tblGridView.Columns["Role"]).ItemsSource = itemSourceRole;


    as soon i click on anywhere on my grid the combobox selected value disappears and shows the wmpty cell. Please help!


  8. Dimitrina
    Dimitrina avatar
    3769 posts

    Posted 03 Aug 2015 Link to this post


    You populate GridViewComboBoxColumn with Role objects and there is not property RoleId defined for them.
    I believe you should switch the way you set the Binding to:
    DataMemberBinding="{Binding RoleId, Mode=TwoWay}" SelectedValueMemberPath="pkOperatorRoleId

    How does this work for you?

    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
  9. Muhammad Owais
    Muhammad Owais avatar
    2 posts
    Member since:
    Jul 2015

    Posted 12 Aug 2015 in reply to Dimitrina Link to this post

    Yes it does! Thanks alot.
Back to Top
DevCraft banner