Class TreeGridColumn
Configures Tree Grid column.
Inherited Members
Namespace: Syncfusion.Blazor.TreeGrid
Assembly: Syncfusion.Blazor.dll
Syntax
public class TreeGridColumn : SfDataBoundComponent, ISfCircularComponent
Constructors
TreeGridColumn()
Initializes a new instance of the TreeGridColumn class.
Declaration
public TreeGridColumn()
Properties
AllowAdding
If AllowAdding set to false, then it disables add operation of a particular column. By default all columns are editable.
Declaration
public bool AllowAdding { get; set; }
Property Value
Type |
---|
System.Boolean |
AllowEditing
If AllowEditing set to false, then it disables editing of a particular column. By default all columns are editable.
Declaration
public bool AllowEditing { get; set; }
Property Value
Type |
---|
System.Boolean |
AllowFiltering
If AllowFiltering set to false, then it disables filtering option and filter bar element of a particular column. By default all columns are filterable.
Declaration
public bool AllowFiltering { get; set; }
Property Value
Type |
---|
System.Boolean |
AllowReordering
If AllowReordering set to false, then it disables reorder of a particular column. By default all columns can be reorder.
Declaration
public bool AllowReordering { get; set; }
Property Value
Type |
---|
System.Boolean |
AllowResizing
If AllowResizing set to false, it disables resize option of a particular column.
Declaration
public bool AllowResizing { get; set; }
Property Value
Type |
---|
System.Boolean |
AllowSorting
If AllowSorting set to false, then it disables sorting option of a particular column. By default all columns are sortable.
Declaration
public bool AllowSorting { get; set; }
Property Value
Type |
---|
System.Boolean |
ClipMode
Defines the cell content's overflow mode. 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 also it will display tooltip while hover on ellipsis applied cell.
Declaration
public ClipMode ClipMode { get; set; }
Property Value
Type |
---|
ClipMode |
Columns
Used to render multiple header rows(stacked headers) on TreeGrid header.
Declaration
public List<TreeGridColumn> Columns { get; set; }
Property Value
Type |
---|
System.Collections.Generic.List<TreeGridColumn> |
Commands
Commands provides an option to display command buttons in every cell. The available built-in command buttons are Edit - Edit the record. Delete - Delete the record. Save - Save the record. Cancel - Cancel the edit state.
Declaration
public List<TreeGridCommandColumn> Commands { get; set; }
Property Value
Type |
---|
System.Collections.Generic.List<TreeGridCommandColumn> |
CustomAttributes
The CSS styles and attributes of the content cells of a particular column can be customized.
Declaration
public IDictionary<string, object> CustomAttributes { get; set; }
Property Value
Type |
---|
System.Collections.Generic.IDictionary<System.String, System.Object> |
DefaultValue
Defines default values for the component when adding a new record to the TreeGrid.
Declaration
public object DefaultValue { get; set; }
Property Value
Type |
---|
System.Object |
DisableHtmlEncode
If DisableHtmlEncode is set to true, it encodes the HTML of the header and content cells.
Declaration
public bool DisableHtmlEncode { get; set; }
Property Value
Type |
---|
System.Boolean |
DisplayAsCheckBox
If DisplayAsCheckBox is set to true, it displays the column value as a check box instead of Boolean value.
Declaration
public bool DisplayAsCheckBox { get; set; }
Property Value
Type |
---|
System.Boolean |
EditorSettings
Defines the object to customize default cell editors. The following types can be used to customize default
editors.
NumericEditCellParams -
Customizes the default numerictextbox editor.
DropDownEditCellParams -
Customizes the default dropdown editor.
DateEditCellParams -
Customizes the default datepicker editor.
BooleanEditCellParams -
Customizes the default checkbox editor.
Declaration
public IEditorSettings EditorSettings { get; set; }
Property Value
Type |
---|
IEditorSettings |
EditTemplate
Defines the cell edit template that is used as editor for a particular column. It accepts either template string or HTML element ID.
Declaration
public RenderFragment<object> EditTemplate { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.RenderFragment<System.Object> |
EditType
Defines the type of component for editing.
Declaration
public EditType EditType { get; set; }
Property Value
Type |
---|
EditType |
Field
Defines the field name of column which is mapped with mapping name of DataSource. The bounded columns can be sort, filter etc., The Field name must be a valid JavaScript identifier, the first character must be an alphabet and should not contain spaces and special characters.
Declaration
public string Field { get; set; }
Property Value
Type |
---|
System.String |
FilterItemTemplate
Defines the Checkbox Item template that renders customized element/value in each checkbox of the Filter column.
Declaration
public RenderFragment<object> FilterItemTemplate { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.RenderFragment<System.Object> |
Remarks
The parameters passed to the templates can be accessed using implicit parameter named context
.
The context is of type FilterItemTemplateContext.
FilterSettings
Defines the filter options to customize filtering for the particular column.
Declaration
public FilterSettings FilterSettings { get; set; }
Property Value
Type |
---|
FilterSettings |
FilterTemplate
Defines the filter template/UI that is used as filter for a particular column. It accepts either template string or HTML element ID.
Declaration
public RenderFragment<object> FilterTemplate { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.RenderFragment<System.Object> |
Format
It is used to change display value with the given format and does not affect the original data. Gets the format from the user which can be standard or custom.
Declaration
public string Format { get; set; }
Property Value
Type |
---|
System.String |
Formatter
Defines the method which is used to achieve custom formatting from an external function. This function triggers before rendering of each cell.
Declaration
public object Formatter { get; set; }
Property Value
Type |
---|
System.Object |
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.
Examples
<SfTreeGrid @ref="TreeGrid" DataSource="@TreeGridData" >
<TreeGridColumns>
<TreeGridColumn Field="TaskId" HeaderText="Task ID"
Freeze="FreezeDirection.Left" IsFrozen="true" Width="80"
TextAlign="Syncfusion.Blazor.Grids.TextAlign.Right"></TreeGridColumn>
<TreeGridColumn Field="TaskName" Freeze="FreezeDirection.Right" IsFrozen="true"
HeaderText="Task Name" Width="160"></TreeGridColumn>
...
</TreeGridColumns>
</SfTreeGrid>
HeaderTemplate
Defines the header template as string or HTML element ID which is used to add customized element in the column header.
Declaration
public RenderFragment<object> HeaderTemplate { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.RenderFragment<System.Object> |
HeaderText
Defines the header text of column which is used to display in column header. If HeaderText is not defined, then field name value will be assigned to header text.
Declaration
public string HeaderText { get; set; }
Property Value
Type |
---|
System.String |
HeaderTextAlign
Define the alignment of column header which is used to align the text of column header.
Declaration
public TextAlign HeaderTextAlign { get; set; }
Property Value
Type |
---|
TextAlign |
HideAtMedia
Column visibility can change based on Media Queries
.
HideAtMedia accepts only valid Media Queries.
Declaration
public string HideAtMedia { get; set; }
Property Value
Type |
---|
System.String |
Index
Gets the unique identifier value of the column. It is used to get the object.
Declaration
public int Index { get; set; }
Property Value
Type |
---|
System.Int32 |
IsFrozen
You can use this property to freeze selected columns in grid.
Declaration
public bool IsFrozen { get; set; }
Property Value
Type |
---|
System.Boolean |
IsIdentity
If IsIdentity is set to true, then this column is considered as identity column.
Declaration
public bool IsIdentity { get; set; }
Property Value
Type |
---|
System.Boolean |
IsPrimaryKey
If IsPrimaryKey is set to true, considers this column as the primary key constraint.
Declaration
public bool IsPrimaryKey { get; set; }
Property Value
Type |
---|
System.Boolean |
LockColumn
If LockColumn is set to true, then it disables Reordering of a particular column. The locked column will be moved to first position.
Declaration
public bool LockColumn { get; set; }
Property Value
Type |
---|
System.Boolean |
MaxWidth
Defines the maximum width of the column in pixels or percentage, which will restrict resizing beyond this pixels or percentage.
Declaration
public string MaxWidth { get; set; }
Property Value
Type |
---|
System.String |
MinWidth
Defines the minimum width of the column in pixels or percentage.
Declaration
public string MinWidth { get; set; }
Property Value
Type |
---|
System.String |
ShowCheckbox
If ShowCheckbox is set to true, then the checkboxes will be displayed in particular column.
Declaration
public bool ShowCheckbox { get; set; }
Property Value
Type |
---|
System.Boolean |
ShowColumnMenu
If ShowColumnMenu is set to false, then it disable the column menu of a particular column. By default column menu will show for all columns.
Declaration
public bool ShowColumnMenu { get; set; }
Property Value
Type |
---|
System.Boolean |
ShowInColumnChooser
If ShowInColumnChooser is set to false, then hides the particular column in column chooser. By default all columns are displayed in column Chooser.
Declaration
public bool ShowInColumnChooser { get; set; }
Property Value
Type |
---|
System.Boolean |
Template
Defines the column template that renders customized element in each cell of the column.
Declaration
public RenderFragment<object> Template { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.RenderFragment<System.Object> |
TextAlign
Defines the alignment of the column in both header and content cells.
Declaration
public TextAlign TextAlign { get; set; }
Property Value
Type |
---|
TextAlign |
Type
Defines the data type of the column.
Declaration
public ColumnType Type { get; set; }
Property Value
Type |
---|
ColumnType |
Uid
Gets the unique identifier value of the column. It is used to get the object.
Declaration
public string Uid { get; set; }
Property Value
Type |
---|
System.String |
ValidationRules
Defines rules to validate data before creating and updating. The validation rules can be set as instance of ValidationRules.
Declaration
public ValidationRules ValidationRules { get; set; }
Property Value
Type |
---|
ValidationRules |
Visible
If Visible is set to false, hides the particular column. By default, columns are displayed.
Declaration
public bool Visible { get; set; }
Property Value
Type |
---|
System.Boolean |
Width
Defines the width of the column in pixels or percentage.
Declaration
public string Width { get; set; }
Property Value
Type |
---|
System.String |
Methods
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder | __builder |
OnInitializedAsync()
Method invoked when the component is ready to start, having received its initial parameters from its parent in the render tree. Override this method if you will perform an asynchronous operation and want the component to refresh when that operation is completed.
Declaration
protected override Task OnInitializedAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A System.Threading.Tasks.Task representing any asynchronous operation. |
Overrides
OnParametersSetAsync()
Method invoked when the component has received parameters from its parent in the render tree, and the incoming values have been assigned to properties.
Declaration
protected override Task OnParametersSetAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A System.Threading.Tasks.Task representing any asynchronous operation. |