IsMainColumn Property
See Also  Example
Xceed.Wpf.DataGrid Assembly > Xceed.Wpf.DataGrid Namespace > Column Class : IsMainColumn Property

Gets or sets a value indicating whether the column is a grid's main (primary) column.

Syntax

Visual Basic (Declaration) 
Public Property IsMainColumn As Boolean
C# 
public bool IsMainColumn {get; set;}

Return Value

true if the column is a grid's main column; false otherwise. The main column can also be retrieved through the MainColumn property exposed by a grid's Columns collection.

Example

All examples in this topic assume that the grid is bound to the Orders table of the Northwind database, unless stated otherwise.
The following example demonstrates how to set the ShipName column as a grid's main column.
XAMLCopy Code
<?XML:NAMESPACE PREFIX = Grid xmlns /><Grid xmlns:xcdg="http: datagrid" xaml wpf schemas.xceed.com><CRLF>  <GRID.RESOURCES><CRLF>    <?xml:namespace prefix = xcdg /><xcdg:DataGridCollectionViewSource x:Key="cvs_orders" 
                                    Source="{Binding Source={x:Static Application.Current}

Remarks

By default, when a grid is in a card-view layout, the data displayed in a card's title is determined by a grid's main (primary) column. The content of the cell whose field name matches the field name of the main column will be displayed in the corresponding card's title. If left unmodified, the main column will be the first column that is added to a grid's Columns collection; however, the main column can be changed by setting a column's IsMainColumn property to true.

The CellContentTemplate of the main column is also used to display the default content of the scrolltip.

Notes

The last column whose IsMainColumn property has been set to true will be considered as a grid's main column.

Requirements

Supported Frameworks: Microsoft .NET Framework version 3.5

See Also

Reference

Column Class
Column Members

Basic Concepts

Card Views