Class TreeGridColumnBuilder
Inheritance
System.Object
Syncfusion.EJ2.ControlBuilder
TreeGridColumnBuilder
Assembly: Syncfusion.EJ2.dll
Syntax
public class TreeGridColumnBuilder : ControlBuilder
Constructors
TreeGridColumnBuilder()
Declaration
public TreeGridColumnBuilder()
TreeGridColumnBuilder(List<TreeGridColumn>)
Declaration
public TreeGridColumnBuilder(List<TreeGridColumn> collection)
Parameters
Type |
Name |
Description |
System.Collections.Generic.List<TreeGridColumn> |
collection |
|
Methods
Add()
Declaration
AllowEditing(Boolean)
Controls whether editing is permitted for the column. By default, all columns are editable.
Declaration
public TreeGridColumnBuilder AllowEditing(bool allowEditing)
Parameters
Type |
Name |
Description |
System.Boolean |
allowEditing |
|
Returns
AllowFiltering(Boolean)
Controls whether the column supports filtering. If set to false, users cannot filter data by this column.
Declaration
public TreeGridColumnBuilder AllowFiltering(bool allowFiltering)
Parameters
Type |
Name |
Description |
System.Boolean |
allowFiltering |
|
Returns
AllowReordering(Boolean)
Enables or disables the reordering of this column via drag-and-drop. Allows for dynamic column adjustments.
Declaration
public TreeGridColumnBuilder AllowReordering(bool allowReordering)
Parameters
Type |
Name |
Description |
System.Boolean |
allowReordering |
|
Returns
AllowResizing(Boolean)
Determines if this column can be resized. If false, the column size is fixed.
Declaration
public TreeGridColumnBuilder AllowResizing(bool allowResizing)
Parameters
Type |
Name |
Description |
System.Boolean |
allowResizing |
|
Returns
AllowSorting(Boolean)
Specifies whether sorting is enabled for this column. Set to false to prevent sort actions.
Declaration
public TreeGridColumnBuilder AllowSorting(bool allowSorting)
Parameters
Type |
Name |
Description |
System.Boolean |
allowSorting |
|
Returns
ClipMode(ClipMode)
Determines how overflow content is handled within a cell. Options include:
Clip
: Truncates the content.
Ellipsis
: Shows ellipsis for overflow.
EllipsisWithTooltip
: Shows ellipsis and tooltip on hover.
Declaration
public TreeGridColumnBuilder ClipMode(ClipMode clipMode)
Parameters
Returns
Columns(Action<TreeGridStackedColumnBuilder>)
Declaration
public TreeGridColumnBuilder Columns(Action<TreeGridStackedColumnBuilder> columns)
Parameters
Returns
Columns(List<TreeGridStackedColumn>)
Declaration
public TreeGridColumnBuilder Columns(List<TreeGridStackedColumn> columns)
Parameters
Returns
Columns(Object)
Declaration
public TreeGridColumnBuilder Columns(object columns)
Parameters
Type |
Name |
Description |
System.Object |
columns |
|
Returns
Columns(String[])
Declaration
public TreeGridColumnBuilder Columns(string[] columns)
Parameters
Type |
Name |
Description |
System.String[] |
columns |
|
Returns
Commands(Object)
Provides built-in command button options for cells. Options include Edit, Delete, Save, and Cancel.
Custom command button implementations are possible.
Declaration
public TreeGridColumnBuilder Commands(object commands)
Parameters
Type |
Name |
Description |
System.Object |
commands |
|
Returns
CustomAttributes(Object)
Enables the addition of CSS styles and attributes for the content cells in a particular column.
Declaration
public TreeGridColumnBuilder CustomAttributes(object customAttributes)
Parameters
Type |
Name |
Description |
System.Object |
customAttributes |
|
Returns
DefaultValue(String)
Sets default values when new records are added to the TreeGrid involving this column.
Declaration
public TreeGridColumnBuilder DefaultValue(string defaultValue)
Parameters
Type |
Name |
Description |
System.String |
defaultValue |
|
Returns
DisableHtmlEncode(Boolean)
If set to true
, the HTML content within header and content cells is encoded to prevent injection attacks.
Declaration
public TreeGridColumnBuilder DisableHtmlEncode(bool disableHtmlEncode)
Parameters
Type |
Name |
Description |
System.Boolean |
disableHtmlEncode |
|
Returns
DisplayAsCheckBox(Boolean)
Displays the column value as a checkbox instead of a Boolean value when set to true
.
Declaration
public TreeGridColumnBuilder DisplayAsCheckBox(bool displayAsCheckBox)
Parameters
Type |
Name |
Description |
System.Boolean |
displayAsCheckBox |
|
Returns
Edit(Object)
Allows customizing the default edit cell through the IEditCell
object for more control over editing.
Declaration
public TreeGridColumnBuilder Edit(object edit)
Parameters
Type |
Name |
Description |
System.Object |
edit |
|
Returns
EditType(String)
Specifies the component type used for editing cells within this column.
Declaration
public TreeGridColumnBuilder EditType(string editType)
Parameters
Type |
Name |
Description |
System.String |
editType |
|
Returns
Field(String)
Specifies the field name in the data source to which the column is bound. This field is used for operations like sorting and filtering.
The field name must be a valid JavaScript identifier, beginning with a letter and avoiding spaces and special characters.
Declaration
public TreeGridColumnBuilder Field(string field)
Parameters
Type |
Name |
Description |
System.String |
field |
|
Returns
Filter(Object)
Customizes filter options for the column, enabling specialized filtering functionality.
Declaration
public TreeGridColumnBuilder Filter(object filter)
Parameters
Type |
Name |
Description |
System.Object |
filter |
|
Returns
FilterBarTemplate(Object)
Allows for a custom component within the filter bar, facilitating advanced filter interfaces.
Includes create and read functions for custom component management.
Declaration
public TreeGridColumnBuilder FilterBarTemplate(object filterBarTemplate)
Parameters
Type |
Name |
Description |
System.Object |
filterBarTemplate |
|
Returns
Formats the displayed value of the column without affecting the underlying data. Supports standard and custom formats for numbers and dates.
Declaration
public TreeGridColumnBuilder Format(string format)
Parameters
Type |
Name |
Description |
System.String |
format |
|
Returns
Allows for custom cell content formatting using an external method, executed prior to rendering.
Declaration
public TreeGridColumnBuilder Formatter(object formatter)
Parameters
Type |
Name |
Description |
System.Object |
formatter |
|
Returns
Freeze(FreezeDirection)
Determines which side (left, right, or center) the column should be frozen on.
Declaration
public TreeGridColumnBuilder Freeze(FreezeDirection freeze)
Parameters
Returns
HeaderTemplate(String)
Customizes the header content with a template, defined as a string or an HTML element ID.
Declaration
public TreeGridColumnBuilder HeaderTemplate(string headerTemplate)
Parameters
Type |
Name |
Description |
System.String |
headerTemplate |
|
Returns
HeaderText(String)
Specifies the text displayed in the column header. If omitted, the field
value is used as the header text.
Declaration
public TreeGridColumnBuilder HeaderText(string headerText)
Parameters
Type |
Name |
Description |
System.String |
headerText |
|
Returns
HeaderTextAlign(TextAlign)
Aligns the text in the column header. By default, the alignment corresponds to other content alignments.
Declaration
public TreeGridColumnBuilder HeaderTextAlign(TextAlign headerTextAlign)
Parameters
Type |
Name |
Description |
TextAlign |
headerTextAlign |
|
Returns
Adjusts column visibility based on Media Queries. Accepts valid CSS media query strings for responsive adjustments.
Declaration
public TreeGridColumnBuilder HideAtMedia(string hideAtMedia)
Parameters
Type |
Name |
Description |
System.String |
hideAtMedia |
|
Returns
IsFrozen(Boolean)
Allows the column to be frozen, keeping it stationary while scrolling horizontally through the grid.
Declaration
public TreeGridColumnBuilder IsFrozen(bool isFrozen)
Parameters
Type |
Name |
Description |
System.Boolean |
isFrozen |
|
Returns
IsIdentity(Boolean)
Identifies the column as an identity column in database terms, if set to true
.
Declaration
public TreeGridColumnBuilder IsIdentity(bool isIdentity)
Parameters
Type |
Name |
Description |
System.Boolean |
isIdentity |
|
Returns
IsPrimaryKey(Boolean)
Identifies the column as a primary key if set to true
, enforcing uniqueness.
Declaration
public TreeGridColumnBuilder IsPrimaryKey(bool isPrimaryKey)
Parameters
Type |
Name |
Description |
System.Boolean |
isPrimaryKey |
|
Returns
LockColumn(Boolean)
Prevents column reordering when set to true, locking the column into a set position.
Declaration
public TreeGridColumnBuilder LockColumn(bool lockColumn)
Parameters
Type |
Name |
Description |
System.Boolean |
lockColumn |
|
Returns
MaxWidth(Double)
Defines the maximum allowable width of the column in pixels or as a percentage, preventing resizing beyond this limit.
Declaration
public TreeGridColumnBuilder MaxWidth(double maxWidth)
Parameters
Type |
Name |
Description |
System.Double |
maxWidth |
|
Returns
MaxWidth(String)
Defines the maximum allowable width of the column in pixels or as a percentage, preventing resizing beyond this limit.
Declaration
public TreeGridColumnBuilder MaxWidth(string maxWidth)
Parameters
Type |
Name |
Description |
System.String |
maxWidth |
|
Returns
MinWidth(Double)
Determines the minimum width of the column in pixels or percentage. This ensures the column does not shrink below this size.
Declaration
public TreeGridColumnBuilder MinWidth(double minWidth)
Parameters
Type |
Name |
Description |
System.Double |
minWidth |
|
Returns
MinWidth(String)
Determines the minimum width of the column in pixels or percentage. This ensures the column does not shrink below this size.
Declaration
public TreeGridColumnBuilder MinWidth(string minWidth)
Parameters
Type |
Name |
Description |
System.String |
minWidth |
|
Returns
ShowCheckbox(Boolean)
Displays checkboxes in the column when enabled, allowing for selections and certain operations.
Declaration
public TreeGridColumnBuilder ShowCheckbox(bool showCheckbox)
Parameters
Type |
Name |
Description |
System.Boolean |
showCheckbox |
|
Returns
ShowColumnMenu(Boolean)
Decides if the column menu should be available, providing options for column customization.
Declaration
public TreeGridColumnBuilder ShowColumnMenu(bool showColumnMenu)
Parameters
Type |
Name |
Description |
System.Boolean |
showColumnMenu |
|
Returns
ShowInColumnChooser(Boolean)
Determines whether the column should appear in the Column Chooser. Set to false to exclude it.
Declaration
public TreeGridColumnBuilder ShowInColumnChooser(bool showInColumnChooser)
Parameters
Type |
Name |
Description |
System.Boolean |
showInColumnChooser |
|
Returns
SortComparer(Object)
Provides a custom sort comparer property to control how sorting is handled for this column's data.
Declaration
public TreeGridColumnBuilder SortComparer(object sortComparer)
Parameters
Type |
Name |
Description |
System.Object |
sortComparer |
|
Returns
SortComparer(String)
Provides a custom sort comparer property to control how sorting is handled for this column's data.
Declaration
public TreeGridColumnBuilder SortComparer(string sortComparer)
Parameters
Type |
Name |
Description |
System.String |
sortComparer |
|
Returns
Template(String)
Customizes the rendering of cell content using either a template string or HTML element ID.
Declaration
public TreeGridColumnBuilder Template(string template)
Parameters
Type |
Name |
Description |
System.String |
template |
|
Returns
TextAlign(TextAlign)
Specifies the horizontal alignment for the column content and header. Options include alignment to the left, center, or right.
Declaration
public TreeGridColumnBuilder TextAlign(TextAlign textAlign)
Parameters
Returns
Type(String)
Defines the type of data stored in the column, which may be string, number, date, or other types.
Declaration
public TreeGridColumnBuilder Type(string type)
Parameters
Type |
Name |
Description |
System.String |
type |
|
Returns
Uid(String)
Retrieves the unique identifier for the column. This UID is used internally to reference and manipulate the column.
Declaration
public TreeGridColumnBuilder Uid(string uid)
Parameters
Type |
Name |
Description |
System.String |
uid |
|
Returns
ValidationRules(Object)
Establishes validation rules to ensure data integrity during creation and updates.
Declaration
public TreeGridColumnBuilder ValidationRules(object validationRules)
Parameters
Type |
Name |
Description |
System.Object |
validationRules |
|
Returns
ValueAccessor(Object)
Applies custom cell values using an external function, allowing for dynamic display adjustments.
Declaration
public TreeGridColumnBuilder ValueAccessor(object valueAccessor)
Parameters
Type |
Name |
Description |
System.Object |
valueAccessor |
|
Returns
ValueAccessor(String)
Applies custom cell values using an external function, allowing for dynamic display adjustments.
Declaration
public TreeGridColumnBuilder ValueAccessor(string valueAccessor)
Parameters
Type |
Name |
Description |
System.String |
valueAccessor |
|
Returns
Visible(Boolean)
Toggles the visibility of the column. Set to false to hide the column from view. Columns are visible by default.
Declaration
public TreeGridColumnBuilder Visible(bool visible)
Parameters
Type |
Name |
Description |
System.Boolean |
visible |
|
Returns
Width(Double)
Sets the column's width in pixels or as a percentage. This defines how the column will occupy space in the grid.
Declaration
public TreeGridColumnBuilder Width(double width)
Parameters
Type |
Name |
Description |
System.Double |
width |
|
Returns
Width(String)
Sets the column's width in pixels or as a percentage. This defines how the column will occupy space in the grid.
Declaration
public TreeGridColumnBuilder Width(string width)
Parameters
Type |
Name |
Description |
System.String |
width |
|
Returns