Gets or sets the cell template.

Namespace: Dapfor.Wpf.Controls
Assembly: Dapfor.Wpf (in Dapfor.Wpf.dll) Version: (


public DataTemplate CellTemplate { get; set; }
Visual Basic
Public Property CellTemplate As DataTemplate
Visual C++
property DataTemplate^ CellTemplate {
	DataTemplate^ get ();
	void set (DataTemplate^ value);
member CellTemplate : DataTemplate with get, set

Property Value

Type: DataTemplate
The cell template.


Cell templatization enables usage of any controls in grid cells via data templates. Templates are usually defined as resources in XAML files. To use a template, it should be set in the required grid column.

Cell data templates enable simple binding to cell content. For this purpose an object of Cell type is transferred as Content. This object has many useful properties including Cell.Text can be used for displaying text.

An object of Cell type has Cell.Value property that can be used to get unformatted values of data objects. These values can be used in cell data templates via converters.

 Copy imageCopy
<!-- Resources --> 
  <TestApplication:MyCollection x:Key="someCollection" /> 
  <TestApplication:IntToFlagValueConverter x:Key="intToFlagConverter"/> 
  <DataTemplate x:Key="cellTemplate"> 
      <Image Source="{Binding Path=Value, Converter={StaticResource intToFlagConverter}}"/> 
      <Grid Grid.Column="1"> 
        <Ellipse Fill="Green"/> 
        <TextBlock Text="{Binding Path=Text}" HorizontalAlignment="Center" Foreground="Red"/> 
        <ColumnDefinition Width="Auto"/> 

<!-- GridControl declaration --> 
<df:GridControl Name="grid"> 
      <df:Column Id="Value1" Title="Column 0" CellTemplate="{StaticResource cellTemplate}" Width="100" /> 
      <df:Column Id="Value2" Title="Column 1" Width="100" /> 

See Also