Version

Fix Fields

You can fix fields to an edge of the xamDataPresenter™ control or the xamDataGrid™ control by setting a Field object’s FixedLocation property to a FixedFieldLocation enum value. You can fix fields programmatically at run time or declaratively at design time regardless of a Field object’s AllowFixingResolved property value.

xamDataPresenter Fix Fields.png

The following example code demonstrates how to pin fields.

In 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>

In Visual Basic:

Imports Infragistics.Windows.DataPresenter
...
'This line of code assumes you have a field layout with a field named "name"
Me.xamDataPresenter1.FieldLayouts(0).Fields("name").FixedLocation = FixedFieldLocation.FixedToNearEdge
'Or you can execute a command
'Me.xamDataPresenter1.ExecuteCommand(DataPresenterCommands.FixFieldNear, Me.xamDataPresenter1.FieldLayouts(0).Fields("name"))

In C#:

using Infragistics.Windows.DataPresenter;
...
this.xamDataPresenter1.FieldLayouts[0].Fields["name"].FixedLocation = FixedFieldLocation.FixedToNearEdge;
//Or you can execute a command
//this.xamDataPresenter1.ExecuteCommand(DataPresenterCommands.FixFieldNear, this.xamDataPresenter1.FieldLayouts[0].Fields["name"])