バージョン

ItemTemplate のバインド

このコントロールは廃止されたため、XamDataGrid コントロールに移行することをお勧めします。今後、新機能、バグ修正、サポートは提供されません。コードベースの XamDataGrid への移行に関する質問は、サポートまでお問い合わせください。

ItemTemplate プロパティをデータ テンプレートのインスタンスに設定することによってコンテンツを列に追加できます。UnboundDataContext オブジェクトには、以下のプロパティが含まれます。

  • Value - これは ValueConverter から返される値です。

  • ColumnKey - これは非バインド列の列キーです。

  • RowData - 現在の行が示すデータ オブジェクトを表示します。

以下のコードは、ItemBinding を使用して非バインド列でデータを表示する方法を示します。

XAML の場合:

<ig:UnboundColumn Key="Total Units" ValueConverter="{StaticResource TotalUnitsConverter}">
   <ig:UnboundColumn.ItemTemplate>
      <DataTemplate>
         <StackPanel>
            <TextBlock Text="{Binding Value}"></TextBlock>
            <TextBlock Text="{Binding ColumnKey}"></TextBlock>
            <TextBlock Text="{Binding RowData.ProductID}"></TextBlock>
         </StackPanel>
      </DataTemplate>
   </ig:UnboundColumn.ItemTemplate>
</ig:UnboundColumn>

関連トピック