GridViewComboBoxColumn is blank after lost focus

3 posts, 0 answers
  1. Matthew
    Matthew avatar
    6 posts
    Member since:
    Aug 2013

    Posted 27 Oct Link to this post

    Dear Telerik,

    I am having the same problem as in this post: http://www.telerik.com/forums/gridviewcomboboxcolumn-lost-value-when-lost-focus

    however, I believe that I have set all values required:

     <telerik:RadGridView Name="PFGrid" AutoGenerateColumns="False" Height="228" ScrollMode="RealTime" ScrollViewer.CanContentScroll="True" ScrollViewer.VerticalScrollBarVisibility="Auto"
                                         NewRowPosition="Top"
                                         AlternationCount="2"
                                         AutoExpandGroups="False" 
                                         CanUserDeleteRows="True" 
                                         CanUserInsertRows="True"
                                         ShowColumnFooters="False"
                                         ShowColumnHeaders="True"
                                         ShowColumnSortIndexes="False"
                                         ShowGroupFooters="False"
                                         ShowGroupPanel="False"
                                         RowEditEnded="PFGrid_RowEditEnded"
                                         EditTriggers="Default" 
                                         Loaded="PFGrid_Loaded"
                                         >
                        <telerik:RadGridView.Columns>
                            <telerik:GridViewComboBoxColumn Header="Quote Section" UniqueName="MaterialType" Width="100" IsFilterable="False" 
                                                            IsGroupable="False" IsReorderable="False" IsSortable="False" 
                                                            DataMemberBinding="{Binding MATERIALTYPE_UID}"
                                                            DisplayMemberPath="MATERIALTYPE_NAME"
                                                            SelectedValueMemberPath="MATERIALTYPE_UID"
                                                            ShowDistinctFilters="False" TextWrapping="Wrap">
                            </telerik:GridViewComboBoxColumn>

     

    materialtypes is an array of my business object and is set on UserControl Loaded using my API calls:

    materialtypes = MainWindow.dataclient.GetMATERIAL_TYPE(new MATERIAL_TYPE(), " ORDER BY MATERIALTYPE_NAME ASC ");

    PFGrid.ItemsSource is also set on UserControl loaded:
    formulas = MainWindow.dataclient.GetPOST_FORMULA(f, " ORDER BY POST_FORMULA_MATERIAL_TYPEDetail.MATERIALTYPE_NAME ASC ");
    PFGrid.ItemsSource = formulas;

    GridViewComboBoxColumn ItemsSource property is set on Grid Loaded event:
    ((GridViewComboBoxColumn)this.PFGrid.Columns[0]).ItemsSource = materialtypes;

     

    Any help would be appreciated.

    thanks.

  2. Matthew
    Matthew avatar
    6 posts
    Member since:
    Aug 2013

    Posted 27 Oct Link to this post

    My apologies,

    I have found my error as described in this post: http://www.telerik.com/forums/gridviewcomboboxcolumn-not-displaying-selected-value

    my error was binding the combobox to a property of the business object instead of binding the combobox to a property of the Grid's itemssource.

    Thanks.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    280 posts

    Posted 28 Oct Link to this post

    Hi Matthew,

    I am glad to see that you have managed to resolve your issue. Thank you for sharing the solution as it might help other customers in the same situation.

    Regards,
    Stefan Nenchev
    Telerik by Progress
    Do you need help with upgrading your WPF project? Try the Telerik API Analyzer and share your thoughts!
Back to Top