Custom Cells in XAML: CellTemplate
If you prefer to create custom cells in XAML instead of writing code, you can do that as well. The C1FlexGridColumn object has a CellTemplate property that you can use to specify the visual elements responsible for showing and editing cells in the column.
For example, the XAML code below defines custom visual elements used to show and edit values in a column. Cells in that column are shown as green, bold, center-aligned text, and edited using a textbox that has an edit icon next to it:
<c1:C1FlexGrid x:Name="_fgTemplated">
<c1:C1FlexGrid.Columns>
<!-- add a templated column -->
<c1:Column ColumnName="_colTemplated" Header="Template" Width="200">
<!-- template for cells in display mode -->
<c1:Column.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}"
Foreground="Green" FontWeight="Bold"
VerticalAlignment="Center"/>
</DataTemplate>
</c1:Column.CellTemplate>
</c1:Column>
</c1:C1FlexGrid.Columns>
</c1:C1FlexGrid>