See Also

FieldLayout Members  | Infragistics.Windows.DataPresenter Namespace  | Settings Property  | FieldSettings Property  | FieldLayoutSettings Property  | DefaultFieldLayout Property  | FieldLayouts Property

Language

Visual Basic

C#

Show All

See Also Languages Infragistics3.Windows.DataPresenter.v7.1

FieldLayout Class

Infragistics.Windows.DataPresenter Namespace : FieldLayout Class (Infragistics.Windows.DataPresenter)

Used in a Infragistics.Windows.DataPresenter.DataPresenterBase to define the layout of Infragistics.Windows.DataPresenter.Fields for one or more items.

For a list of all members of this type, see FieldLayout members.

Object Model








Syntax

[Visual Basic]
Public Class FieldLayout    Inherits DependencyObjectNotifier
[C#]
public class FieldLayout : DependencyObjectNotifier

Remarks

DataRecords are created lazily as each item in the DataPresenterBase.DataSource is requested. When a DataRecord is created Infragistics.Windows.DataPresenter.DataPresenterBase's FieldLayouts collection is searched for an existing FieldLayout whose FieldLayout.Fields match the DataRecord.DataItem's properties. If one is not found then a new FieldLayout is created, in which case the FieldLayoutInitializing and FieldLayoutInitialized events will be raised.

Note: If the new FieldLayout's FieldLayout.AutoGenerateFieldsResolved property returns true then the FieldLayout.Fields collection is automatically populated with a Infragistics.Windows.DataPresenter.Field for every public property on the data item. This is done between the FieldLayoutInitializing and FieldLayoutInitialized events.

In any case the AssigningFieldLayoutToItem event is raised to allow a different FieldLayout to be assigned to the DataRecord. Finally the InitializeRecord event is raised.

Refer to the Fields topic in the Developer's Guide for an explanation of fields.

Refer to the Field Layout topic in the Developer's Guide for an explanation of the FieldLayout object.

Refer to the Theory of Operation topic in the Developer's Guide for an explanation of how this object is used.

Example

[XAML] The following example demonstrates how to create a FieldLayout and add it to the FieldLayouts property of a DataPresenterBase derived control. It also demonstrates how to create and initialize the FieldSettings of a FieldLayout and create the Fields that will make up that FieldLayout including the use of UnboundField instances.

<igDP:XamDataGrid x:Name="XamDataGrid12" BindToSampleData="true">
    
<igDP:XamDataGrid.FieldLayouts>
        
<!-- define a field layout that will match the data -->
        
<igDP:FieldLayout>

            
<!-- initialize settings for the fields in this specific field layout -->
            
<igDP:FieldLayout.FieldSettings>
                
<igDP:FieldSettings CellClickAction="SelectRecord"/>
            
</igDP:FieldLayout.FieldSettings>

            
<!-- define the fields for the field layout -->
            
<igDP:FieldLayout.Fields>
                
<igDP:Field Name="name" Label="Name"/>
                
<igDP:Field Name="department" Label="Dept." />
                
<igDP:Field Name="salary" Label="Salary"/>
                
<igDP:Field Name="email" Label="Email"/>
                
<!--
                    The XamDataGrid allows you to include Unbound Fields in a
                    FieldLayout. This sample shows how you can use
                    Unbound Fields to include calculated values. 
-->
                
<igDP:UnboundField Name="SubTotal" Label="Sub-total"></igDP:UnboundField>
                
<igDP:UnboundField Name="SalesTax" Label="Sales Tax (7%)" />
                
<igDP:UnboundField Name="Total" Label="Total" DataType="{x:Type sys:Decimal}"></igDP:UnboundField>
            
</igDP:FieldLayout.Fields>

        
</igDP:FieldLayout>
    
</igDP:XamDataGrid.FieldLayouts>
</igDP:XamDataGrid>

See Also

FieldLayout Members  | Infragistics.Windows.DataPresenter Namespace  | Settings Property  | FieldSettings Property  | FieldLayoutSettings Property  | DefaultFieldLayout Property  | FieldLayouts Property

E-mail your feedback on this topic.

Opinion about our help? Take our survey.

Copyright © 2003-2007 Infragistics, Inc. All rights reserved.

Build Version: 7.1.20071.1320