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

[Solved] GridviewComboBoxColumn not opening

2 Answers 137 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Chad
Top achievements
Rank 1
Chad asked on 11 Aug 2011, 03:00 PM
Hi!

Having a problem with a GridviewCombobox column. I am using MVVM and have the Gridview populated. The GridviewComboBoxColumn even populates with the correct value, but when i click on the column, it does not open up the dropdown. I've checked all the properties of the column and the gridview that might cause the column to not be editable and so far no luck. the other fields that are not comboboxcolumns are able to be edited and work just fine. FYI all these controls are Telerik controls, just overloaded. here is my XAML and viewmodel
Namespace ViewModels
 
    Public Class vm_RatesMaintenance
        Inherits ViewModelBase
 
        Dim RIA_rates_context As alflex.RIA_rates_service
        Private ReadOnly _Rates As QueryableDomainServiceCollectionView(Of tbl_service_to_ins)
 
 
        Public Sub New()
            RIA_rates_context = New alflex.RIA_rates_service()
            Dim GetRatesQuery As EntityQuery(Of tbl_service_to_ins) = RIA_rates_context.GetTbl_service_to_insQuery
            _Rates = New QueryableDomainServiceCollectionView(Of tbl_service_to_ins)(RIA_rates_context, GetRatesQuery)
            _Rates.PageSize = 10
            _Rates.AutoLoad = True
            RIA_rates_context.Load(RIA_rates_context.GetTbl_serviceQuery)
 
        End Sub
 
        Public ReadOnly Property Rates() As QueryableDomainServiceCollectionView(Of tbl_service_to_ins)
            Get
                Return Me._Rates
            End Get
        End Property
 
        Public ReadOnly Property Services() As EntitySet(Of tbl_service)
            Get
                Return RIA_rates_context.tbl_services
            End Get
        End Property
    End Class
<
alflexControls:GridView Height="532" AutoGenerateColumns="True" x:Name="RadGridView1" VerticalAlignment="Top" ItemsSource="{Binding Rates}" Margin="0,44,0,0" CanUserFreezeColumns="False" RowIndicatorVisibility="Collapsed">
     <alflexControls:GridView.Columns>
             <alflexControls:GridViewComboBoxColumn DataMemberBinding="{Binding tbl_service.srvc_id, Mode=TwoWay}" ItemsSourceBinding="{Binding Services, Mode=TwoWay, Source={StaticResource vm_RatesMaintenance}}" SelectedValueMemberPath="srvc_id" DisplayMemberPath="rate" Header="Service Code" IsReadOnly="False" ></alflexControls:GridViewComboBoxColumn>
             <alflexControls:GridViewDataColumn DataMemberBinding="{Binding rate}" Header="Rate" IsFilterable="False"/>
             <alflexControls:GridViewDataColumn DataMemberBinding="{Binding unit_time}" Header="Unit Time" IsFilterable="False"/>
             <alflexControls:GridViewDataColumn DataMemberBinding="{Binding session_units}" Header="session_units" IsFilterable="False"/>
             <alflexControls:GridViewDataColumn DataMemberBinding="{Binding is_daily_srvc}" Header="is_daily_srvc" IsFilterable="False"/>
         </alflexControls:GridView.Columns>
     </alflexControls:GridView>

2 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 11 Aug 2011, 04:02 PM
Hi Chad,

 
You should use ItemsSource rather than ItemsSourceBinding:

<alflexControls:GridViewComboBoxColumn DataMemberBinding="{Binding tbl_service.srvc_id, Mode=TwoWay}" ItemsSource="{Binding Services, Mode=TwoWay, Source={StaticResource vm_RatesMaintenance}}" SelectedValueMemberPath="srvc_id" DisplayMemberPath="rate" Header="Service Code" IsReadOnly="False" ></alflexControls:GridViewComboBoxColumn>

Regards,
Vanya Pavlova
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
Chad
Top achievements
Rank 1
answered on 13 Aug 2011, 05:04 AM
Hi Vanya,

Thanks for the reply. I had already tried ItemSource and it was unsucessful.

But the good news is i found the issue. We apparently mis-named either the selectedValuepath or DisplayMemberPath. We think this caused the dropdown to not be editable.

Thanks for your help!
Tags
GridView
Asked by
Chad
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Chad
Top achievements
Rank 1
Share this question
or