2

I need to bind DataGridTemplateColumn.ClipboardContentBinding to SelectedItem of a Combobox that placed inside that.In fact I need to bind Combobox.SelectedItem to the current row of DataGrid.I tried the code below but it doesn't work.

 <DataGrid ItemsSource="{Binding CommentCollection}">
    <DataGrid.Columns>
       <DataGridTemplateColumn Header="Description" Width="*">
           <DataGridTemplateColumn.CellTemplate>
              <DataTemplate>
                 <ComboBox DisplayMemberPath="Name" 
                   ItemsSource="{Binding DataContext.CommentCollection,Source={x:Reference GrdSpecDataContext}}"
                   SelectedItem="{Binding .,Mode=TwoWay}"/>
               </DataTemplate>
            </DataGridTemplateColumn.CellTemplate>
          </DataGridTemplateColumn>
      </DataGrid.Columns>
  </DataGrid>

Please don't tell me I don't need to put ComboBox here or something like that.It's a simple sample,but I need to know it.

Shahin
  • 12,543
  • 39
  • 127
  • 205
mahboub_mo
  • 2,908
  • 6
  • 32
  • 72

0 Answers0