title: Silverlight GridViewComboBoxColumn Binding Commands with MVVM Not working
body: <p>I am trying to run a command from a GridViewColumn, and the RadGridView is bound to my ViewModel.  The code below runs the command, but when I select a value from the ComboBox, it saves the row immediately without allowing me to make changes to other cells first.  This behavior happens whether or not I have the command bound to the RADComboBox.  If I take the command away, still happens.</p>
  
  <p>XAML:</p>
  
  <pre><code>&lt;telerik:RadGridView x:Name="GV1"
                               ItemsSource="{Binding Path=Material}"
                               AutoGenerateColumns="False"
                               IsReadOnly="{Binding IsGridReadOnly}"
                                            ShowGroupPanel="False" 
                               VerticalAlignment="Top"
                               HorizontalAlignment="Center"
                              RowDetailsVisibilityMode="VisibleWhenSelected"&gt;
         &lt;i:Interaction.Triggers&gt;
            &lt;i:EventTrigger EventName="RowEditEnded"&gt;
                  &lt;cmd:EventToCommand Command="{Binding RowEditEndedCommand}"
                                                    PassEventArgsToCommand="True" /&gt;
            &lt;/i:EventTrigger&gt;
               &lt;i:EventTrigger EventName="CancelRowEdit"&gt;
                  &lt;cmd:EventToCommand Command="{Binding CancelEditCommand}" /&gt;
               &lt;/i:EventTrigger&gt;
            &lt;/i:Interaction.Triggers&gt;
  &lt;telerik:RadGridView.Columns&gt;
  &lt;telerik:GridViewColumn Header="Material Code"&gt;
                  &lt;telerik:GridViewColumn.CellEditTemplate&gt;
                     &lt;DataTemplate&gt;
                        &lt;telerik:RadComboBox ItemsSource="{Binding DataSource.AllMaterials, Source={StaticResource DCP}}"
                                                DisplayMemberPath="Code"
                                                SelectedValuePath="Code"
                                                SelectedValue="{Binding Path=MaterialCode, Mode=TwoWay}"
                                                IsEnabled="{Binding Path=IsMaterialEditable, Mode=TwoWay}" 
                                                Command="{Binding DataSource.MaterialCodeChangedCommand, Source={StaticResource DCP}}"/&gt;
                     &lt;/DataTemplate&gt;
                     &lt;/telerik:GridViewColumn.CellEditTemplate&gt;
                  &lt;telerik:GridViewColumn.CellTemplate&gt;
                     &lt;DataTemplate&gt;
                        &lt;TextBlock Text="{Binding MaterialCode}" /&gt;
                     &lt;/DataTemplate&gt;
                  &lt;/telerik:GridViewColumn.CellTemplate&gt;
               &lt;/telerik:GridViewColumn&gt;
      &lt;!--7 Other Columns here--&gt;
  &lt;/telerik:RadGridView.Columns&gt;
      &lt;/telerik:RadGridView&gt;
  </code></pre>
  
  <p>Code Behind</p>
  
  <pre><code>public RelayCommand MaterialCodeChangedCommand { get; private set; }
  //IN Constructor
  this.MaterialTypeChangedCommand = new RelayCommand(MaterialTypeChange);
  
  private void MaterialCodeChange()
    {
       //Command code here
    }
  </code></pre>
  
  <p>When I take the ComboBox out of the CellEditTemplate and try to use the GridViewComboBox, I can't figure out how to get the binding to work, but it doesn't fire off the RowEditEnded just by selecting the drop down so that part work correctly with this code:</p>
  
  <pre><code>&lt;telerik:GridViewComboBoxColumn Header="Material Type" 
                                                    ItemsSource="{Binding DataSource.AllTypeCodes, Source={StaticResource DCP}}"
                                                    SelectedValueMemberPath="Code"
                                                    DataMemberBinding="{Binding Path=MaterialType, Mode=TwoWay}"
                                                    DisplayMemberPath="Display"&gt;
                      &lt;i:Interaction.Triggers&gt;
                         &lt;i:EventTrigger EventName="SelectionChanged"&gt;
                            &lt;i:InvokeCommandAction Command="{Binding DataSource.MaterialTypeChangedCommand, Source={StaticResource DCP}}"/&gt;
                         &lt;/i:EventTrigger&gt;
                      &lt;/i:Interaction.Triggers&gt;
                   &lt;/telerik:GridViewComboBoxColumn&gt;
  </code></pre>
  
  <p>If this is unclear let me know, it's late and I may not be clear.  Thanks for any help you can offer.  I should note that the RowEditEnded acts like this on other drop downs in my application as well when set up in the CellEditTemplate.  Converting to the to the GridViewComboBoxCOlumn resolves that but then the binding issue...</p>