Field オブジェクトの FixedLocation プロパティを FixedFieldLocation 列挙値に設定することによって、xamDataPresenter™ コントロールまたは xamDataGrid™ コントロールのエッジにフィールドを固定できます。Field オブジェクトの AllowFixingResolved プロパティ値に関係なく、ランタイムにプログラム的に、またはデザインタイムに宣言的にフィールドを固定できます。
以下のコード例は、フィールドをピン固定する方法を示します。
XAML の場合:
<igDP:XamDataPresenter Name="xamDataPresenter1" BindToSampleData="True">
<igDP:XamDataPresenter.FieldLayouts>
<igDP:FieldLayout>
<igDP:FieldLayout.Fields>
<igDP:Field Name="name" FixedLocation="FixedToNearEdge" />
</igDP:FieldLayout.Fields>
</igDP:FieldLayout>
</igDP:XamDataPresenter.FieldLayouts>
</igDP:XamDataPresenter>
Visual Basic の場合:
Imports Infragistics.Windows.DataPresenter
...
'このコード行は、フィールド名 "name" を持つフィールド レイアウトがあると想定します
Me.xamDataPresenter1.FieldLayouts(0).Fields("name").FixedLocation = FixedFieldLocation.FixedToNearEdge
'またはコマンドを実行できます
'Me.xamDataPresenter1.ExecuteCommand(DataPresenterCommands.FixFieldNear, Me.xamDataPresenter1.FieldLayouts(0).Fields("name"))
C# の場合:
using Infragistics.Windows.DataPresenter; ... this.xamDataPresenter1.FieldLayouts[0].Fields["name"].FixedLocation = FixedFieldLocation.FixedToNearEdge; //またはコマンドを実行できます //this.xamDataPresenter1.ExecuteCommand(DataPresenterCommands.FixFieldNear, this.xamDataPresenter1.FieldLayouts[0].Fields["name"])