Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

DataGridTemplateColumn.CellEditingTemplate ComboBox Binding to Datatable

$
0
0

Hi

I have a datagrid and one of the columns is a DataGridTemplateColumn and it has a combobox as it's CellEditingTemplate. Is it possible to binf the combobox to a DataTable?


<DataGridTemplateColumn Header="Class" Width="40" HeaderStyle="{StaticResource ResourceKey=HeaderCenterAlign}">
  <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
      <TextBlock Text="{Binding Path=RateClassCode}" ToolTip="{Binding Path=RateClassDescription}" HorizontalAlignment="Center" />
    </DataTemplate>
  </DataGridTemplateColumn.CellTemplate>
  <DataGridTemplateColumn.CellEditingTemplate>
    <DataTemplate>
      <ComboBox x:Name="cmbRateClasses" ItemsSource="{Binding}" /> <!--I need to populate this combo from a Datatable -->
    </DataTemplate>
  </DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>

Thanks


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>