Class GridColumn
Provides the base functionalities for all the column types in SfDataGrid.
Inheritance
Inherited Members
Namespace: Syncfusion.UI.Xaml.Grid
Assembly: Syncfusion.SfGrid.WPF.dll
Syntax
public abstract class GridColumn : GridColumnBase, IDisposable, INotifyDependencyPropertyChanged, IFilterDefinition
Constructors
GridColumn()
Declaration
protected GridColumn()
Fields
AllowBlankFiltersProperty
Identifies the AllowBlankFilters dependency property.
Declaration
public static readonly DependencyProperty AllowBlankFiltersProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the AllowBlankFilters dependency property.
AllowDraggingProperty
Identifies the AllowDragging dependency property.
Declaration
public static readonly DependencyProperty AllowDraggingProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the AllowDragging dependency property.
AllowFilteringProperty
Identifies the AllowFiltering dependency property.
Declaration
public static readonly DependencyProperty AllowFilteringProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the AllowFiltering dependency property.
AllowGroupingProperty
Identifies the AllowGrouping dependency property.
Declaration
public static readonly DependencyProperty AllowGroupingProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the AllowGrouping dependency property.
AllowResizingProperty
Identifies the AllowResizing dependency property.
Declaration
public static readonly DependencyProperty AllowResizingProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the AllowResizing dependency property.
ColumnSizerProperty
Identifies the ColumnSizer dependency property.
Declaration
public static readonly DependencyProperty ColumnSizerProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the ColumnSizer dependency property.
FilterPopupStyleProperty
Identifies the FilterPopupStyle dependency property.
Declaration
public static readonly DependencyProperty FilterPopupStyleProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the FilterPopupStyle dependency property.
FilterPopupTemplateProperty
Identifies the FilterPopupTemplate dependency property.
Declaration
public static readonly DependencyProperty FilterPopupTemplateProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the FilterPopupTemplate dependency property.
FilterRowCellStyleProperty
Identifies the FilterRowCellStyle dependency property.
Declaration
public static readonly DependencyProperty FilterRowCellStyleProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the FilterRowCellStyle dependency property.
FilterRowConditionProperty
Identifies the FilterRowCondition dependency property.
Declaration
public static readonly DependencyProperty FilterRowConditionProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the FilterRowCondition dependency property.
FilterRowOptionsVisibilityProperty
Identifies the FilterRowOptionsVisibility dependency property.
Declaration
public static readonly DependencyProperty FilterRowOptionsVisibilityProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the FilterRowOptionsVisibility dependency property.
FilterRowTextProperty
Identifies the FilterRowText dependency property.
Declaration
public static readonly DependencyProperty FilterRowTextProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the FilterRowText dependency property.
GroupModeProperty
Identifies the GroupMode dependency property.
Declaration
public static readonly DependencyProperty GroupModeProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the GroupMode dependency property.
ImmediateUpdateColumnFilterProperty
Identifies the ImmediateUpdateColumnFilter dependency property.
Declaration
public static readonly DependencyProperty ImmediateUpdateColumnFilterProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the ImmediateUpdateColumnFilter dependency property.
IsCaseSensitiveFilterRowProperty
Identifies the IsCaseSensitiveFilterRow dependency property.
Declaration
public static readonly DependencyProperty IsCaseSensitiveFilterRowProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the IsCaseSensitiveFilterRow dependency property.
SortModeProperty
Identifies the SortMode dependency property.
Declaration
public static readonly DependencyProperty SortModeProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the SortMode dependency property.
UseBindingValueProperty
Identifies the
Declaration
public static readonly DependencyProperty UseBindingValueProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the
Properties
AllowBlankFilters
Get or sets a value that indicates whether the blank values are allowed for filtering in column.
Declaration
public bool AllowBlankFilters { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the blank values are allowed for filtering in column; otherwise, false. The default value is true. |
See Also
AllowDragging
Gets or sets a value that indicates whether the user can rearrange the columns.
Declaration
public bool AllowDragging { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the user can re arrange the columns; otherwise, false. The default value is false . |
See Also
AllowFiltering
Gets or sets a value that indicates whether to enable UI Filtering in column header to filter the column.
Declaration
public bool AllowFiltering { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the UI filtering is enabled in the column ; otherwise, false.The default value is false. |
Remarks
The filtering operation can be canceled or customized through FilterChanging and FilterChanged events in SfDataGrid.
See Also
AllowGrouping
Gets or sets a value indicates whether the user can drag and drop the column to GroupDropArea.
Declaration
public bool AllowGrouping { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the user can drag and drop the column to GroupDropArea; otherwise, false. The default value is true . |
Remarks
This property will takes higher priority than AllowGrouping property.
See Also
AllowResizing
Gets or sets a value that indicates whether the user can resize the column.
Declaration
public bool AllowResizing { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the user can adjust the column width; otherwise, false. The default value is false . |
CellType
Gets the cell type of the column which denotes renderer associated with column.
Declaration
public string CellType { get; }
Property Value
Type | Description |
---|---|
System.String | A string that represents the cell type of the column. |
ColumnFilter
Gets or sets a value that decides whether to filter based on display value or based on MappingName.
Declaration
public ColumnFilter ColumnFilter { get; set; }
Property Value
Type | Description |
---|---|
ColumnFilter | One of the ColumnFilter enumeration that decides how the items populated for the filter control in the column.
By default, the filter value is populated based on |
See Also
ColumnMemberType
Gets or sets the member type to load the appropriate AdvancedFilterType to AdvancedFilterControl .
Declaration
public Type ColumnMemberType { get; set; }
Property Value
Type | Description |
---|---|
System.Type | The type that loads the appropriate AdvancedFilterType to AdvancedFilterControl in column. |
Remarks
By default, the AdvancedFilterControl loads TextFilter , when the underlying data source is dynamic. So , you can decide the appropriate AdvancedFilterType by using this property based on its member type. For example, the TextFilter for string type , NumberFilter for numeric type and the DateFilter for DateTime type of member.
See Also
ColumnSizer
Gets or sets the value that indicates how the column width is determined.
Declaration
public GridLengthUnitType ColumnSizer { get; set; }
Property Value
Type | Description |
---|---|
GridLengthUnitType | One of the GridLengthUnitType enumeration that adjust the column width. The default value is None. |
DataGrid
Gets the reference to the SfDataGrid control.
Declaration
protected SfDataGrid DataGrid { get; }
Property Value
Type |
---|
SfDataGrid |
FilterBehavior
Gets or sets a value that decides whether filter value should be considered as string type or its underlying type while filtering.
Declaration
public FilterBehavior FilterBehavior { get; set; }
Property Value
Type | Description |
---|---|
FilterBehavior | One of the |
Remarks
The Advanced Filter UI will be loaded based on this property.
See Also
FilteredFrom
Gets a value that determines whether the column is filtered from Check box filter UI or Advanced filter in UI Filtering.
Declaration
public FilteredFrom FilteredFrom { get; set; }
Property Value
Type | Description |
---|---|
FilteredFrom | One of FilteredFrom enumeration that specifies when the column is from . |
See Also
FilterPopupStyle
Gets or sets the style applied to the filter popup in column.
Declaration
public Style FilterPopupStyle { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Style | The style that is applied to the filter pop-up in GridColumn. The default value is null. |
Remarks
To define a System.Windows.Style for filter pop-up, specify a TargetType of GridFilterControl.
See Also
FilterPopupTemplate
Gets or sets System.Windows.DataTemplate that defines the visual representation of the filter pop-up in GridColumn.
Declaration
public DataTemplate FilterPopupTemplate { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.DataTemplate | The object that defines the visual representation of the filter pop-up in GridColumn. The default value is null. |
See Also
FilterPredicates
Gets the collection of FilterPredicate in the column.
Declaration
public ObservableCollection<FilterPredicate> FilterPredicates { get; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.ObservableCollection<FilterPredicate> | The collection of filter predicate in the column. |
FilterRowCellStyle
Gets or sets the style applied to the FilterRow cell of the column.
Declaration
public Style FilterRowCellStyle { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Style | The style that is applied to the FilterRow cell of the column. The default value is null. |
Remarks
To define a System.Windows.Style for a FilterRow cell, specify a TargetType of GridFilterRowCell.
See Also
FilterRowCondition
Gets or sets a value that decides the default FilterRowCondition that have to be filter while typing in corresponding FilterRow cell.
Declaration
public FilterRowCondition FilterRowCondition { get; set; }
Property Value
Type |
---|
FilterRowCondition |
Remarks
The FilterRowCell which loads the TextBox, Numeric or DateTime editor allows you to edit the values to filter in the corresponding column. Where you can change the default conditions that want to be applied for the particular filtering as per the editor that have been loaded.
Editor | Default FilterRowCondition |
---|---|
TextBox | BeginsWith |
Numeric | Equals |
DateTime | Equals |
See Also
FilterRowEditorType
Gets or sets a value which denotes the Editor which have to be load in corresponding FilterRowCell.
Declaration
public string FilterRowEditorType { get; set; }
Property Value
Type |
---|
System.String |
Remarks
The name which refers the renderers in FilterRowCellRenderers collection. By default, the corresponding renderer will be loaded based on underlying type.
Name | Renderers |
---|---|
TextBox | GridFilterRowTextBoxRenderer |
Numeric | GridFilterRowNumericRenderer |
CheckBox | GridFilterRowCheckBoxRenderer |
DateTime | GridFilterRowDateTimeRenderer |
ComboBox | GridFilterRowComboBoxRenderer |
MultiSelectComboBox | GridFilterRowMultiSelectRenderer |
FilterRowOptionsVisibility
Gets or sets a value that indicates whether the FilterRowOptions button is visible in the GridFilterRowCell.
Declaration
public Visibility FilterRowOptionsVisibility { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Visibility | One of the System.Windows.Visibility enumeration that specifies the FilterRowOptions button visiblity in GridFilterRowCell; The default value is Visibility.Visible . |
See Also
FilterRowText
Gets the filtered value of the particular column where the filtering has been applied through FilterRow.
Declaration
public object FilterRowText { get; protected set; }
Property Value
Type | Description |
---|---|
System.Object | The filtered value that is applied FilterRow in the particular column. The default value is null. |
See Also
GroupMode
Gets or sets a value that decides whether grouping is processed based on display value or edit value of column.
Declaration
public DataReflectionMode GroupMode { get; set; }
Property Value
Type | Description |
---|---|
DataReflectionMode | Default mode performs default grouping operation based on value. Display mode performs grouping operation based on display value of column. Value mode performs grouping operation based on actual value of column. |
Remarks
Group key is set based on
ImmediateUpdateColumnFilter
Gets or sets a value that indicates whether the data is automatically filtered as soon as an user selects or types value in the filter pop-up of column.
Declaration
public bool ImmediateUpdateColumnFilter { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the data is filtered automatically; otherwise false. The default value is false. |
See Also
IsCaseSensitiveFilterRow
Gets or sets value that indicates whether the case sensitive filtering is enabled on FilterRowCell of a particular column.
Declaration
public bool IsCaseSensitiveFilterRow { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the case sensitive filtering is enabled on the FilterRowCell of a column; otherwise, false. The default value is false. |
SortMode
Gets or sets a value that decides whether sorting is processed based on display value or edit value of column.
Declaration
public DataReflectionMode SortMode { get; set; }
Property Value
Type | Description |
---|---|
DataReflectionMode | Default mode performs default sorting operation based on value. Display mode performs sorting operation based on display value of column. Value mode performs sorting operation based on actual value of column. |
UseBindingValue
Gets or sets a value that indicates whether the binding gets property value from column wrapper instead of reflecting value from the item properties.
Declaration
public bool UseBindingValue { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the property value gets from column wrapper; otherwise, false. The default value is false. |
Remarks
This property helps to perform sorting, filtering, grouping operations on complex or indexer properties.
Methods
CanAllowSpinOnMouseScroll()
Determines whether to increment and decrement the cell value in mouse wheel and up,down arrow key is pressed.
Declaration
protected virtual bool CanAllowSpinOnMouseScroll()
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the cell value can be rotated using mouse wheel or up and down arrow key ; otherwise false . |
CanEditCell(Int32)
Determines whether the column is editable.
Declaration
protected virtual bool CanEditCell(int rowIndex = -1)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | The corresponding rowIndex of the editable cell. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if all the cells with in the column is editable . |
CanEndEditColumn()
Determines whether the boolean type columns can EndEdit or not.
Declaration
protected virtual bool CanEndEditColumn()
Returns
Type | Description |
---|---|
System.Boolean | Returns true, if the column is boolean type, otherwise false. |
Remarks
Override this method to determine whether the EndEdit should be processed for boolean type columns or not. For all other column types EndEdit will be processed based on the IsEditable property.
CanFocus()
Determines whether the corresponding column can receive focus.
Declaration
protected virtual bool CanFocus()
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the column is loaded with editor in its CellTemplate. |
CreateInstanceCore()
Initializes a new instance of the GridColumn class.
Declaration
protected override Freezable CreateInstanceCore()
Returns
Type | Description |
---|---|
System.Windows.Freezable | Returns the new instance of column in SfDataGrid. |
Overrides
Dispose(Boolean)
Releases all resources used by the SfDataGrid and Columns.
Declaration
protected override void Dispose(bool isDisposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | isDisposing | Indicates whether the call is from Dispose method or from a finalizer. |
Overrides
GetFilterRowOptionsVisibility()
Gets the value that indicates the visibility of FilterOption button.
Declaration
protected virtual Visibility GetFilterRowOptionsVisibility()
Returns
Type | Description |
---|---|
System.Windows.Visibility | Returns Visible if FilterOptions is required for the particular FilterRowCell. |
GetRowFilterType()
Gets the AdvancedFilterType of the parituclar column
Declaration
protected virtual string GetRowFilterType()
Returns
Type | Description |
---|---|
System.String | Returns the editor type which need to be load in GridFilterRowCell. |
IsHiddenColumn()
Determines whether the corresponding column is hidden or not.
Declaration
protected virtual bool IsHiddenColumn()
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the column is hidden or width is zero otherwise false. |
OnCellTemplateChanged(DependencyPropertyChangedEventArgs)
Invoked when the
Declaration
protected override void OnCellTemplateChanged(DependencyPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyPropertyChangedEventArgs | e | The System.Windows.DependencyPropertyChangedEventArgs that contains data for CellTemplate dependency property changes. |
Overrides
OnCellTemplateSelectorChanged(DependencyPropertyChangedEventArgs)
Invoked when the CellTemplateSelector dependency property is changed in column.
Declaration
protected override void OnCellTemplateSelectorChanged(DependencyPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.DependencyPropertyChangedEventArgs | e | The System.Windows.DependencyPropertyChangedEventArgs that contains data for the CellTemplateSelector dependency property changes. |
Overrides
OnDependencyPropertyChanged(String, DependencyPropertyChangedEventArgs)
Invoked whenever the value of any dependency property in the column has been updated.
Declaration
public void OnDependencyPropertyChanged(string propertyName, DependencyPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyName | The property name that has changed in column. |
System.Windows.DependencyPropertyChangedEventArgs | e | System.Windows.DependencyPropertyChangedEventArgs that contains the data for various dependency property changed events. |
SetCellType(String)
Sets the cell type which indicates the renderer for the column.
Declaration
protected void SetCellType(string cellType)
Parameters
Type | Name | Description |
---|---|---|
System.String | cellType | Specifies the corresponding cell type of the column. |
SetDisplayBindingConverter()
Sets the converter for the DisplayBinding of column.
Declaration
protected override void SetDisplayBindingConverter()
Overrides
Remarks
You can override this method to specify the converter for DisplayBinding.
SetFilterRowText(String)
Set the FilterRowText while applying the Filtered from FilterRow
Declaration
protected virtual void SetFilterRowText(string filterRowText)
Parameters
Type | Name | Description |
---|---|---|
System.String | filterRowText | FilterText of that column |
UpdateBindingBasedOnAllowEditing()
Updates the binding based on the allowediting.
Declaration
protected override void UpdateBindingBasedOnAllowEditing()