ItemTemplate Binding
Please note that this control has been retired and is now obsolete to the XamDataGrid control, and as such, we recommend migrating to that control. It will not be receiving any new features, bug fixes, or support going forward. For help or questions on migrating your codebase to the XamDataGrid, please contact support.
You can add content to the column by setting the ItemTemplate property to an instance of a data template. The UnboundDataContext object contains the following properties:
-
Value – this is the value returned from the ValueConverter
-
ColumnKey – this is the column key of the unbound column
-
RowData – the data object that the current row represents would represent
The following code demonstrates how to display data in an unbound column using ItemBinding.
<ig:UnboundColumn Key="Total Units" ValueConverter="{StaticResource TotalUnitsConverter}">
<ig:UnboundColumn.ItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding Value}" />
<TextBlock Text="{Binding ColumnKey}" />
<TextBlock Text="{Binding RowData.ProductID}" />
</StackPanel>
</DataTemplate>
</ig:UnboundColumn.ItemTemplate>
</ig:UnboundColumn>