Class GridUnboundColumn
Represents a column which displays an additional information in columns which are not bound with data object.
Inheritance
Inherited Members
Namespace: Syncfusion.WinForms.DataGrid
Assembly: Syncfusion.SfDataGrid.WinForms.dll
Syntax
public class GridUnboundColumn : GridColumn, IDisposable, IFilterDefinition
Examples
The following example shows how to create the unbound column.
GridUnboundColumn column1 = new GridUnboundColumn();
column1.CaseSensitive = false;
column1.MappingName = "SubTotal";
column1.HeaderText = "Sub Total";
column1.Expression = "Quantity*unitPrice";
sfDataGrid1.Columns.Add(column1);
Constructors
GridUnboundColumn()
Initializes a new instance of the GridUnboundColumn class.
Declaration
public GridUnboundColumn()
Properties
CaseSensitive
Gets or sets a value indicating whether the expression should be calculated for the columns based on the mapping name with case sensitive.
Declaration
public bool CaseSensitive { get; set; }
Property Value
Type |
---|
System.Boolean |
Expression
Gets or sets an expression which is used to calculate the values for GridUnboundColumn.
Declaration
public string Expression { get; set; }
Property Value
Type |
---|
System.String |
Remarks
When Format and Expression both properties initialized for unbound column, the cell values are calculated based on the Expression and then the format will be applied.
Examples
The following example shows how to initialize the expression for the unbound column.
GridUnboundColumn column = new GridUnboundColumn();
column.MappingName = "GrandTotal";
column.HeaderText = "GrandTotal";
column.Expression = "Quantity*UnitPrice";
sfDataGrid1.Columns.Add(column);
Format
Gets or sets the format pattern string for a column. The composite format pattern string also can be provided.
Declaration
public string Format { get; set; }
Property Value
Type |
---|
System.String |
Remarks
When Format and Expression both properties initialized for unbound column, the cell values are calculated based on the Expression and then the format is applied.
Examples
The following example shows how to initialize the format for the unbound column.
GridUnboundColumn column = new GridUnboundColumn();
column.CaseSensitive = false;
column.MappingName = "GrandTotal";
column.HeaderText = "GrandTotal";
column.Format = "{UnitPrice} for {Quantity}";
sfDataGrid1.Columns.Add(column);
//Initialize the Expression and Format for the GridUnboundColumn.
GridUnboundColumn column1 = new GridUnboundColumn();
column1.MappingName = "SubTotal";
column1.HeaderText = "Sub Total";
column1.Expression = "Quantity*UnitPrice";
column1.Format = "{0:C}";
sfDataGrid1.Columns.Add(column1);