Class GanttColumn
Defines column collection displayed in grid If the columns declaration was empty then columns are automatically populated from taskSettings value.
Inherited Members
Namespace: Syncfusion.Blazor.Gantt
Assembly: Syncfusion.Blazor.dll
Syntax
public class GanttColumn : SfDataBoundComponent
Constructors
GanttColumn()
Initializes a new instance of the GanttColumn class.
Declaration
public GanttColumn()
Properties
AllowEditing
Gets or sets a value indicating whether editing is allowed for the column.
Declaration
public bool AllowEditing { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is |
Remarks
If AllowEditing
is set to false
, the column will not be editable, which means that users will not be able to modify the column's values.
By default, all columns are editable.
AllowFiltering
Gets or sets a value indicating whether filtering is allowed for the column.
Declaration
public bool AllowFiltering { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is |
Remarks
If AllowFiltering
is set to false
, the column will not be filterable, which means that users will not be able to filter the data based on the column's values, and the filter menu element will be disabled for the column.
AllowReordering
Gets or sets whether to enable or disable reordering of columns. Reordering can be done by drag and drop of a particular column from one index to another index.
Declaration
public bool AllowReordering { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if need to allow reordering of columns; otherwise, false. The default value is true. |
Remarks
Determines whether to allow or restrict reordering for specific column.
Examples
<SfGantt DataSource="@TaskCollection" >
<GanttColumns>
<GanttColumn Field = "TaskId" AllowReordering="false"></GanttColumn>
</GanttColumns>
</SfGantt>
See Also
AllowResizing
Gets or sets whether to enable or disable resizing of columns.
Declaration
public bool AllowResizing { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if need to allow resizing of columns; otherwise, false. The default value is true. |
Remarks
Determines whether to allow or restrict resizing for specific column.
Examples
<SfGantt DataSource="@TaskCollection" >
<GanttColumns>
<GanttColumn Field = "TaskId" AllowResizing="false"></GanttColumn>
</GanttColumns>
</SfGantt>
See Also
AllowSorting
Gets or sets a value indicating whether sorting is allowed for a particular column.
Declaration
public bool AllowSorting { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Remarks
By default, all columns are sortable.
Setting this property to false
disables sorting for the column.
ClipMode
Gets or sets the cell content's overflow mode.
Declaration
public ClipMode ClipMode { get; set; }
Property Value
Type | Description |
---|---|
ClipMode | A value of the ClipMode enumeration that specifies the overflow mode. The default value is Ellipsis. |
Remarks
The available modes are:
- Clip: Truncates the cell content when it overflows its area.
- Ellipsis: Displays ellipsis when the cell content overflows its area.
- EllipsisWithTooltip: Displays ellipsis when the cell content overflows its area and displays a tooltip when the user hovers over the ellipsis.
DefaultValue
Gets or sets the default value for the component when adding a new record to the Gantt chart.
Declaration
public string DefaultValue { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value to be used when adding a new record to the Gantt chart. |
Remarks
This property is used to set the default value for the component when adding a new record to the Gantt. The default value will be used if no other value is specified. If this property is not set, the component will use some predefined value to the default columns and use an empty string for custom columns as the default value.
DisableHtmlEncode
Gets or sets a value indicating whether the HTML content of header and content cells should be encoded or not.
Declaration
public bool DisableHtmlEncode { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | When set to |
Remarks
Setting this property to true
ensures that any HTML content in the header and content cells of the grid are encoded, preventing malicious content from being injected and executed by a user's browser.
However, if you have already encoded the content yourself, or if you trust the source of the content, you can set this property to false
.
DisplayAsCheckBox
Gets or sets a value indicating whether to display the column value as a check box instead of a Boolean value.
Declaration
public bool DisplayAsCheckBox { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Remarks
When set to true
, the column value will be displayed as a check box in the UI, and the check box will be checked if the column value is true
and unchecked if the column value is false
.
EditorSettings
Defines the object to customize default cell editors. The following types can be used to customize default editors.
- NumericEditCellParamsCustomizes the default numerictextbox editor.
- DropDownEditCellParamsCustomizes the default dropdown editor.
- DateEditCellParamsCustomizes the default datepicker editor.
- BooleanEditCellParamsCustomizes the default checkbox editor.
Declaration
public IEditorSettings EditorSettings { get; set; }
Property Value
Type |
---|
IEditorSettings |
EditTemplate
Gets or sets the cell edit template that is used as an editor for a particular column.
Declaration
public RenderFragment<object> EditTemplate { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.RenderFragment<System.Object> | A Microsoft.AspNetCore.Components.RenderFragment<> that defines the template used for editing the cell.
The default value is |
Remarks
The template can be defined as an HTML element ID. The template should define the HTML elements and components to be used when editing the cell. When the user clicks on a cell to edit it, the template is rendered in place of the cell contents. When the user saves the changes, the edited value is passed to the component that defines the grid.
EditType
Gets or sets the type of component used for editing.
Declaration
public EditType EditType { get; set; }
Property Value
Type | Description |
---|---|
EditType | An EditType value that defines the type of component used for editing. |
Remarks
The EditType property is used to specify the type of component that is used for editing a cell in the Gantt chart. There are several predefined edit types, such as "Default", "TextArea", "Checkbox", and "Select". When the EditType property is set to a particular value, the Gantt chart uses the corresponding component for editing the cell.
Field
Defines the field name of the column that is mapped with the mapping name of the DataSource.
Declaration
public string Field { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string representing the field name of the column. The default value is an empty string. |
Remarks
Use the Field property to bind the columns for sorting, filtering, and other operations. The field name must match the mapping name specified in the DataSource. If the field name is invalid or does not match the mapping name, an exception may be thrown.
FilterSettings
Defines the filter options to customize filtering for the particular column.
Declaration
public FilterSettings FilterSettings { get; set; }
Property Value
Type | Description |
---|---|
FilterSettings | A FilterSettings object that represents the filter settings for the column. The default value is null, indicating that the column does not support filtering. |
Remarks
Use this property to customize the filtering behavior for a specific column. You can set various filter options, such as filter type, operator, and value. If the FilterSettings property is not set, filtering will not be available for the column. The default value of this property is null, which means that the column does not support filtering by default.
FilterTemplate
Gets or sets the filter template/UI that is used as a filter for a particular column.
Declaration
public RenderFragment<object> FilterTemplate { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.RenderFragment<System.Object> | A Microsoft.AspNetCore.Components.RenderFragment<> representing the template or HTML element ID for the filter. |
Remarks
Use this property to define a custom template or HTML element ID for the filter of a column. The filter template/UI can be defined as a RenderFragment representing an HTML element ID.
Format
It is used to change display value with the given format and does not affect the original data. Gets or sets the format from the user which can be standard or custom.
Declaration
public string Format { get; set; }
Property Value
Type | Description |
---|---|
System.String | The format string used for displaying the property value. The default value is an empty string. |
Remarks
This property provides a way to format the display value of the property without modifying the original data. The format can be specified as either a standard format string or a custom format string. If this property is not set, the default format string used is an empty string.
Formatter
Gets or sets an external function used to achieve custom formatting for the cells in the component.
Declaration
public object Formatter { get; set; }
Property Value
Type | Description |
---|---|
System.Object | An external function that accepts the cell value as an input and returns a formatted string. If not specified, the default formatting for the cell value will be used. |
Remarks
The Formatter property allows you to define a custom formatting function that will be used for each cell in the component. This function should accept the cell value as an input and return a string with the desired formatting applied. The formatting function will be called before rendering each cell, allowing you to apply custom formatting logic based on the cell value or any other criteria.
Freeze
Gets or sets a value that indicates which side column needs to freeze.
Declaration
public FreezeDirection Freeze { get; set; }
Property Value
Type | Description |
---|---|
FreezeDirection | One of the FreezeDirection enumeration that specifies in which direction the columns is frozen. The default mode is Syncfusion.Blazor.Grids.FreezeDirection.Left. |
Remarks
Columns can be frozen both at left and right side of tree grid content. Columns in the center part of tree grid content are scrollable.
HeaderTemplate
Gets or sets the column header template that defines a customized element in the header.
Declaration
public RenderFragment<object> HeaderTemplate { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.RenderFragment<System.Object> | A Microsoft.AspNetCore.Components.RenderFragment<> delegate representing the template to be used for rendering the header. |
Remarks
The header template can be defined as a string or as an HTML element ID. When specified as an HTML element ID, the element will be used as a reference to the template.
HeaderText
Gets or sets the header text of the column which is used to display in the column header. If the HeaderText property is not defined, then the field name value will be assigned to the header text.
Declaration
public string HeaderText { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string value that represents the header text of the column. The default value is field name. |
Remarks
Use the HeaderText property to specify the header text of the column. If the HeaderText property is not set, the field name value will be used as the header text.
HeaderTextAlign
Gets or sets the alignment of the column header text.
Declaration
public TextAlign HeaderTextAlign { get; set; }
Property Value
Type | Description |
---|---|
TextAlign | A value from the TextAlign enumeration that represents the alignment of the column header text. The default value is TextAlign.Left. |
Remarks
Use the HeaderTextAlign property to specify the alignment of the column header text. The available options for alignment are Justify, Left, Center, and Right.
HideAtMedia
Gets or sets the media query at which the column should be hidden.
Declaration
public string HideAtMedia { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string value that represents the media query at which the column should be hidden. The default value is an empty string, which means the column is not hidden based on a media query. |
Remarks
Use the HideAtMedia property to specify the media query at which the column should be hidden. This property accepts only valid Media Queries. If an invalid Media Query is provided, the column will not be hidden.
IsFrozen
Gets or sets whether the gantt column should be frozen.
Declaration
public bool IsFrozen { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | A boolean value that indicates whether the gantt column should be frozen. Set to |
Remarks
Use the IsFrozen property to freeze the gantt column and prevent it from scrolling.
When IsFrozen is set to true
, the gantt column will remain fixed on the screen while the rest of the columns can be scrolled horizontally.
IsIdentity
Gets or sets a value indicating whether the column is an identity column.
Declaration
public bool IsIdentity { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Remarks
When IsIdentity is set to true
, the primary key value for the new record is auto generated by the database.
It is recommended to set the IsPrimaryKey property to true
when using IsIdentity.
IsPrimaryKey
Gets or sets a value indicating whether the column is part of the primary key constraint.
Declaration
public bool IsPrimaryKey { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Remarks
When IsPrimaryKey is set to true
, this column is considered as the primary key constraint.
It is recommended to set IsPrimaryKey to true
when using IsIdentity.
MaxWidth
Gets or sets the maximum width of the column in pixels or percentage.
Declaration
public string MaxWidth { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string value that represents the maximum width of the column in pixels or percentage. |
Remarks
The MaxWidth property specifies the maximum width of the column in pixels or percentage. If the column's width is greater than the specified maximum value, it will restrict resizing beyond this value.
MinWidth
Gets or sets the minimum width of the column in pixels or percentage.
Declaration
public string MinWidth { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string value that represents the minimum width of the column in pixels or percentage. |
Remarks
The MinWidth property specifies the minimum width of the column in pixels or percentage. If the column's width is less than the specified minimum value, it will restrict resizing beyond this value.
ShowCheckbox
Gets or sets a value indicating whether to show checkboxes in the column.
Declaration
public bool ShowCheckbox { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Remarks
When the ShowCheckbox property is set to true, checkboxes will be displayed in the column.
Developers can use this feature to add checkboxes to the column for multiple selections.
The default value of this property is false
, which means the checkboxes will not be displayed by default.
ShowColumnMenu
Gets or sets whether to display the menu options in each column.
Declaration
public bool ShowColumnMenu { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Remarks
Determines whether the columns should display the menu options.
Examples
<SfGantt DataSource="@TaskCollection" >
<GanttColumns>
<GanttColumn Field = "TaskId" ShowColumnMenu="false"></GanttColumn>
</GanttColumns>
</SfGantt>
See Also
ShowInColumnChooser
Gets or sets whether to display the column chooser to dynamically show or hide columns.
Declaration
public bool ShowInColumnChooser { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Remarks
Determines which columns should display the column chooser.
Examples
<SfGantt DataSource="@TaskCollection" >
<GanttColumns>
<GanttColumn Field = "TaskId" ShowInColumnChooser="false"></GanttColumn>
</GanttColumns>
</SfGantt>
See Also
Template
Gets or sets the column template that renders a customized element in each cell of the column.
Declaration
public RenderFragment<object> Template { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.RenderFragment<System.Object> | A Microsoft.AspNetCore.Components.RenderFragment<> that renders the customized element in each cell of the column. |
Remarks
The Template property allows you to define a customized element to render in each cell of the column. Developers can use this feature to display data in a customized way by creating a custom template. To use this property, you must provide a Microsoft.AspNetCore.Components.RenderFragment<> as the template.
TextAlign
Gets or sets the alignment of the column of the content cells.
Declaration
public TextAlign TextAlign { get; set; }
Property Value
Type | Description |
---|---|
TextAlign | A TextAlign enumeration value that specifies the alignment of the column. |
Remarks
The TextAlign
property specifies the alignment of the content in the cells of the column, including the header cell.
By default, the value of this property is set to Left.
You can set this property to any value from the TextAlign enumeration to align the column.
Type
Gets or sets the data type of the column.
Declaration
public ColumnType Type { get; set; }
Property Value
Type | Description |
---|---|
ColumnType | The data type of the column. |
Remarks
This property specifies the type of data that will be stored in the column. Available options for this property are defined in the ColumnType enumeration.
Uid
Gets or sets the unique identifier value of the column. It is used to get the column object from the column collection.
Declaration
public string Uid { get; set; }
Property Value
Type | Description |
---|---|
System.String | The unique identifier value of the column. |
Remarks
Unique id helps to get the particular column object for customizations.
Examples
<SfGantt DataSource="@TaskCollection" >
<GanttColumns>
<GanttColumn Field = "TaskId" Uid="Gantt-Column1"></GanttColumn>
</GanttColumns>
</SfGantt>
Visible
Gets or sets a value indicating whether the particular column is visible or hidden.
Declaration
public bool Visible { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Remarks
Use this property to show or hide the particular column. By default, columns are displayed. When this property is set to false
, the column is hidden. When it is set to true
, the column is visible.
Width
Gets or sets the width of the column in pixels or percentage.
Declaration
public string Width { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string that represents the width of the column. The default value is |
Remarks
Use this property to specify the width of the column. The width can be specified in pixels or percentage. For example, "100px" or "50%".
Methods
Dispose(Boolean)
Dispose unmanaged resources in the Syncfusion Blazor component.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | Boolean value to dispose the object. |
Overrides
OnInitializedAsync()
Declaration
protected override Task OnInitializedAsync()
Returns
Type |
---|
System.Threading.Tasks.Task |
Overrides
OnParametersSetAsync()
Declaration
protected override Task OnParametersSetAsync()
Returns
Type |
---|
System.Threading.Tasks.Task |