Gets or sets DataTemplate for columns.
Namespace: Dapfor.Wpf.ControlsAssembly: Dapfor.Wpf (in Dapfor.Wpf.dll) Version: 4.1.0.26317 (4.1.0.26317)
Syntax
C# |
---|
public DataTemplate TemplateColumn { get; set; } |
Visual Basic |
---|
Public Property TemplateColumn As DataTemplate Get Set |
Visual C++ |
---|
public: property DataTemplate^ TemplateColumn { DataTemplate^ get (); void set (DataTemplate^ value); } |
F# |
---|
member TemplateColumn : DataTemplate with get, set |
Property Value
Type: DataTemplateDataTemplate for columns.
Remarks
GridControl supports column templatization. Programmers can use XAML code to set desired presentation. This requires using Column.ColumnTemplate property
for setting any arbitrary DataTemplate.
Copy | |
---|---|
<Window.Resources> <BitmapImage x:Key="image" UriSource="/Images/dapfor.ico" DecodePixelWidth="16" DecodePixelHeight="16" /> <DataTemplate x:Key="columnTemplate"> <StackPanel Orientation="Horizontal" Height="16" HorizontalAlignment="Center"> <Image Source="{StaticResource image}"/> <Image Source="{StaticResource image}"/> <Image Source="{StaticResource image}"/> <Image Source="{StaticResource image}"/> </StackPanel> </DataTemplate> </Window.Resources> <!--Wpf Grid--> <df:GridControl Name="grid" ItemsSource="{StaticResource someCollection}"> <df:GridControl.Headers> <df:Header> <df:Header.Columns> <df:Column Id="Value1" Title="Column 0" Width="100"/> <df:Column Id="Value2" Title="Column 1" Width="100" ColumnTemplate="{StaticResource columnTemplate}" /> </df:Header.Columns> </df:Header> </df:GridControl.Headers> </df:GridControl> |