DataGridCell Template with WPF Toolkit Datagrid

Jan 13, 2009 at 4:14 PM
Hello All,

How can I use the DataGridCell Template with WPF Toolkit Datagrid. I like to create a Cell Template and like to apply that template for all cells.

For example:

<Style or something x:Key="myDGCellTemplate">
  <DataTemplate>
     <StackPanel>
           <Button Content="AA" />
           <Textbox Text={Binding .}  />
     </StackPanel>
  </DataTemplate>
</Style or something>


<toolkit:DataGrid x:Name="myDataGrid" ItemSource="{Binding myDataSource}"
   CellTempleteORSomething={StaticResource myDGCellTemplate}" AutoGenerateColumns=True>
</toolkit:DataGrid>

#2.

Can I use "." in Binding? As the column will be generated dynamically based on the Data Source, I don't know the column name. So, I want to set whatever column that I got to the textbox.

Thanks in advance.
           <Textbox Text={Binding .}  />
Coordinator
Jan 15, 2009 at 1:33 PM
You should look into using DataGridTemplateColumn.  You can read more on it here, http://blogs.msdn.com/vinsibal/archive/2008/08/19/wpf-datagrid-stock-and-template-columns.aspx.