Version

GridView Class

ViewBase derived class that defines settings and defaults for a view that arranges data using a classic grid layout. The GridView object is used by XamDataGrid and XamDataPresenter
Syntax
'Declaration
 
Public Class GridView 
   Inherits GridViewBase
public class GridView : GridViewBase 
Remarks

The GridView object is used by XamDataGrid and XamDataPresenter to provide settings and defaults that DataPresenterBase (the base class for the XamDataGrid and XamDataPresenter controls) can query when it provides UI element generation and field layout generation services in support of the View. While the GridView is not actually reponsible for arranging items, it does expose a property called ItemsPanelType that returns the System.Windows.Controls.Panel derived type that should be used to provide layout functionality for DataRecords displayed in the view. DataPresenterBase will ensure that a panel of ItemsPanelType is generated for use by the embedded RecordListControl (the System.Windows.Controls.ListBox derived class used to display DataRecords).

The GridView object exposes a property called ViewSettings that returns a GridViewSettings object. (Note: This property is not found on the ViewBase class but is specific to the GridView). GridViewSettings in turn exposes properties that let you control features supported by the GridView. Refer to GridViewSettings object for detailed information on these properties.

Note: GridView is only used by the XamDataPresenter control (as described above) when the XamDataPresenter control's XamDataPresenter.View property is set to an instance of GridView.

The following ViewBase properties are overridden by the CarouselView:

Property Description Overridden Value
AutoFitToRecord Returns a boolean indicating whether the cell area of a DataRecordPresenter will be auto sized to the RecordPresenter itself or based on the root RecordListControl when DataPresenterBase.AutoFitResolved is true. false
CellPresentation Returns the type of CellPresentation used by the view which determines the default manner in which the cells within each row are laid out by the FieldLayoutTemplateGenerator. CellPresentation.GridView
DefaultAutoArrangeCells Returns the default value for AutoArrangeCells for field layout templates generated on behalf of the View. If LogicalOrientation is Vertical then AutoArrangeCells.LeftToRight otherwise AutoArrangeCells.LeftToRight
HasLogicalOrientation Returns a value that indicates whether this View arranges its descendants in a particular dimension. true
IsAutoFitHeightSupported Returns true if the height of the cells within in each row should be adjusted so that all cells will fit within the vertical space available for the row. If ViewSettings.Orientation is System.Windows.Controls.Orientation.Horizontal then true, otherwise false
IsAutoFitWidthSupported Returns true if the width of the cells within in each row should be adjusted so that all cells will fit within the horizontal space available for the row. If ViewSettings.Orientation is System.Windows.Controls.Orientation.Vertical then true, otherwise false
IsFixedRecordsSupported Returns true if the DataPresenterBase should allow records to be fixed at the top or bottomof the UI. true
ItemsPanelType Returns the type of System.Windows.Controls.Panel used by the view to layout items in the list. typeof(GridViewPanel)
LogicalOrientation The System.Windows.Controls.Orientation of the View, if the view only supports layout in a particular dimension. ViewSettings.Orientation
SupportedDataDisplayMode Returns a value that indicates the DataDisplayMode supported by the View. DataDisplayMode.Hierarchical

Example
The following example demonstrates how to initialize the ViewSettings of aXamDataGrid or a XamDataPresenter. In this example, the Orientation is set to Vertical and the UseNestedPanels property is set to 'True'.


    
<!-- Setting UseNestedPanels to true on a XamDataGrid will
         cause nested content to become active. This will enable
         any chrome, animations and triggers relating to
         RecordPresenters' nested content.
-->
    
<igDP:XamDataGrid x:Name="xamDataGrid1">
        
<igDP:XamDataGrid.ViewSettings>
            
<igDP:GridViewSettings UseNestedPanels="True" Orientation="Vertical"/>
        
</igDP:XamDataGrid.ViewSettings>
    
</igDP:XamDataGrid>

    
<!-- Here is how you would set UseNestedPanels properties
         on a XamDataPresenter.
         Note: the default value for UseNestedPanels is false and
               the default value for Orientation is Vertical.
-->
    
<igDP:XamDataPresenter x:Name="xamDataPresenter1">
        
<igDP:XamDataPresenter.View>
            
<igDP:GridView>
                
<igDP:GridView.ViewSettings>
                    
<igDP:GridViewSettings UseNestedPanels="True" Orientation="Vertical"/>
                
</igDP:GridView.ViewSettings>
            
</igDP:GridView>
        
</igDP:XamDataPresenter.View>
    
</igDP:XamDataPresenter>

' Setting UseNestedPanels to true on a XamDataGrid will
' cause nested content to become active. This will enable
' any chrome, animations and triggers relating to
' RecordPresenters' nested content.
Me.xamDataGrid1.ViewSettings.UseNestedPanels = True
Me.xamDataGrid1.ViewSettings.Orientation = Orientation.Vertical

' Here is how you would set ViewSettings properties
' on a XamDataPresenter.
' Note: the default value for UseNestedPanels is false and
'       the default value for Orientation is Vertical.
Dim gv As New Infragistics.Windows.DataPresenter.GridView
gv.ViewSettings.UseNestedPanels = True
gv.ViewSettings.Orientation = Orientation.Vertical
Me.xamDataPresenter1.View = gv
// Setting UseNestedPanels to true on a XamDataGrid will
     // cause nested content to become active. This will enable
     // any chrome, animations and triggers relating to
     // RecordPresenters' nested content.
     this.xamDataGrid1.ViewSettings.UseNestedPanels = true;
     this.xamDataGrid1.ViewSettings.Orientation = Orientation.Vertical;

     // Here is how you would set ViewSettings properties
     // on a XamDataPresenter.
     // Note: the default value for UseNestedPanels is false and
     //       the default value for Orientation is Vertical.
     Infragistics.Windows.DataPresenter.GridView gv 
         = new Infragistics.Windows.DataPresenter.GridView();
     gv.ViewSettings.UseNestedPanels = true;
     gv.ViewSettings.Orientation = Orientation.Vertical;
     this.xamDataPresenter1.View = gv;
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also