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

Issues with the GridViewComboBoxColumn

3 Answers 65 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Stefan Kamphuis
Top achievements
Rank 2
Stefan Kamphuis asked on 23 Jun 2010, 12:38 PM
Hello,

I have an issue where I need some help. I am creating an WPF MVVM application. I have a view with in it displayed a RadGridView. One of the columns of this gridview is a GridViewComboBoxColumn. See code
<telerik:RadGridView x:Name="GridView"  
    ItemsSource="{Binding DataContext.ObservDistributions, ElementName=DistributionView}"  
    AutoGenerateColumns="False"  
    CanUserFreezeColumns="False" 
    acb:CommandBehavior.Event="MouseDoubleClick"  
    acb:CommandBehavior.Command="{Binding SelectCurrentDistributionCommand}" 
    acb:CommandBehavior.CommandParameter="{Binding ElementName=GridView, Path=SelectedItem}"
        <telerik:RadGridView.Columns> 
        <telerik:GridViewDataColumn Header="Name" DataMemberBinding="{Binding Name}" IsReadOnly="True" /> 
        <column:DateTimePickerColumn Header="Date" DataMemberBinding="{Binding DateFrom}" Width="200"></column:DateTimePickerColumn> 
        <telerik:GridViewComboBoxColumn Header="Establishment" ItemsSource="{Binding DataContext.Establishments, ElementName=DistributionView}" SelectedValueMemberPath="EstablishmentId" DisplayMemberPath="Name" DataMemberBinding="{Binding Establishment.EstablishmentId, Mode=TwoWay}"
        </telerik:GridViewComboBoxColumn> 
    </telerik:RadGridView.Columns> 
</telerik:RadGridView> 
              
I have in the ViewModel a ObservableCollection named "ObservDistributions". This all works perfectly. The issue is where I change the value of the GridViewComboBoxColumn. I use MouseDoubleClick to send the changes from the View to the ViewModel.  In the acb:CommandBehavior.CommandParameter I sent the item to the ViewModel with a command. This all works but not for the GridViewComboBoxColumn. The changes made to the GridViewComboBoxColumn are not sent to the ViewModel. I think the issue is with the DataMemberBinding in the GridViewComboBoxColumn. I have used the DateTimePickerColumn from Telerik, changes made with this control works fine.

Does anyone have some hint in what direction to look.

Thanx in advance

Stefan

3 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 23 Jun 2010, 04:14 PM
Hi Stefan Kamphuis,

I am trying to reproduce the issue here. May I have a look at the implementation of your ViewModel ?
By the way the DataMemberBinding of the combo column itself seems OK.  So we should seek the problem somewhere else.

All the best,
Pavel Pavlov
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Stefan Kamphuis
Top achievements
Rank 2
answered on 24 Jun 2010, 07:49 AM
After a good night sleep, I changed the way the screen is build and this issue has solved itself.

Stefan
0
Kareem Azzouny
Top achievements
Rank 1
answered on 19 Feb 2012, 11:44 AM
could you please provide me with the code because i have the same situation here 
Regards
Tags
GridView
Asked by
Stefan Kamphuis
Top achievements
Rank 2
Answers by
Pavel Pavlov
Telerik team
Stefan Kamphuis
Top achievements
Rank 2
Kareem Azzouny
Top achievements
Rank 1
Share this question
or