Table of Contents

Class RadzenDataGridColumn<TItem>

Namespace
Radzen.Blazor
Assembly
Radzen.Blazor.dll

RadzenDataGridColumn component. Must be placed inside a RadzenDataGrid<TItem>

public class RadzenDataGridColumn<TItem> : ComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable

Type Parameters

TItem

The type of the DataGrid item.

Inheritance
RadzenDataGridColumn<TItem>
Implements
Derived
Inherited Members

Constructors

RadzenDataGridColumn()

public RadzenDataGridColumn()

Properties

CalculatedCssClass

Gets or sets a function that calculates the CSS class based on the TItem value.

[Parameter]
public Func<RadzenDataGridColumn<TItem>, TItem, string> CalculatedCssClass { get; set; }

Property Value

Func<RadzenDataGridColumn<TItem>, TItem, string>

The dynamic CSS class applied to data cells.

ColumnPickerTitle

Gets or sets the title in column picker. Value of Title is used when ColumnPickerTitle is not set

[Parameter]
public string ColumnPickerTitle { get; set; }

Property Value

string

The column picker title.

Columns

Gets or sets the columns.

[Parameter]
public RenderFragment Columns { get; set; }

Property Value

RenderFragment

The columns.

ColumnsCollection

Gets the child columns.

public IList<RadzenDataGridColumn<TItem>> ColumnsCollection { get; }

Property Value

IList<RadzenDataGridColumn<TItem>>

The child columns.

CssClass

Gets or sets the CSS class applied to data cells.

[Parameter]
public string CssClass { get; set; }

Property Value

string

The CSS class applied to data cells.

CustomFilterExpression

Gets or sets the custom filter dynamic Linq dictionary.

[Parameter]
public string CustomFilterExpression { get; set; }

Property Value

string

The custom filter dynamic Linq dictionary.

EditTemplate

Gets or sets the edit template.

[Parameter]
public RenderFragment<TItem> EditTemplate { get; set; }

Property Value

RenderFragment<TItem>

The edit template.

FilterOperator

Gets or sets the filter operator.

[Parameter]
public FilterOperator FilterOperator { get; set; }

Property Value

FilterOperator

The filter operator.

FilterPlaceholder

Gets or sets the filter placeholder.

[Parameter]
public string FilterPlaceholder { get; set; }

Property Value

string

The filter placeholder value.

FilterProperty

Gets or sets the filter property name.

[Parameter]
public string FilterProperty { get; set; }

Property Value

string

The filter property name.

FilterPropertyType

Gets the filter property type.

public Type FilterPropertyType { get; }

Property Value

Type

FilterTemplate

Gets or sets the filter template.

[Parameter]
public RenderFragment<RadzenDataGridColumn<TItem>> FilterTemplate { get; set; }

Property Value

RenderFragment<RadzenDataGridColumn<TItem>>

The filter template.

FilterValue

Gets or sets the filter value.

[Parameter]
public object FilterValue { get; set; }

Property Value

object

The filter value.

FilterValueTemplate

Gets or sets the filter value template.

[Parameter]
public RenderFragment<RadzenDataGridColumn<TItem>> FilterValueTemplate { get; set; }

Property Value

RenderFragment<RadzenDataGridColumn<TItem>>

The filter value template.

Filterable

Gets or sets a value indicating whether this RadzenDataGridColumn<TItem> is filterable.

[Parameter]
public bool Filterable { get; set; }

Property Value

bool

true if filterable; otherwise, false.

FooterCssClass

Gets or sets the footer CSS class applied to footer cell.

[Parameter]
public string FooterCssClass { get; set; }

Property Value

string

The footer CSS class applied to footer cell.

FooterTemplate

Gets or sets the footer template.

[Parameter]
public RenderFragment FooterTemplate { get; set; }

Property Value

RenderFragment

The footer template.

FormatString

Gets or sets the format string.

[Parameter]
public string FormatString { get; set; }

Property Value

string

The format string.

Frozen

Gets or sets a value indicating whether this RadzenDataGridColumn<TItem> is frozen.

[Parameter]
public bool Frozen { get; set; }

Property Value

bool

true if frozen will disable horizontal scroll for the column; otherwise, false.

FrozenPosition

Gets or sets the frozen position this RadzenDataGridColumn<TItem>

[Parameter]
public FrozenColumnPosition FrozenPosition { get; set; }

Property Value

FrozenColumnPosition

Left or Right.

Grid

Gets or sets the grid.

[CascadingParameter]
public RadzenDataGrid<TItem> Grid { get; set; }

Property Value

RadzenDataGrid<TItem>

The grid.

GroupFooterCssClass

Gets or sets the group footer CSS class applied to group footer cell.

[Parameter]
public string GroupFooterCssClass { get; set; }

Property Value

string

The group footer CSS class applied to group footer cell.

GroupFooterTemplate

Gets or sets the group footer template.

[Parameter]
public RenderFragment<Group> GroupFooterTemplate { get; set; }

Property Value

RenderFragment<Group>

The group footer template.

GroupProperty

Gets or sets the group property name.

[Parameter]
public string GroupProperty { get; set; }

Property Value

string

The group property name.

Groupable

Gets or sets a value indicating whether this RadzenDataGridColumn<TItem> is groupable.

[Parameter]
public bool Groupable { get; set; }

Property Value

bool

true if groupable; otherwise, false.

HeaderCssClass

Gets or sets the header CSS class applied to header cell.

[Parameter]
public string HeaderCssClass { get; set; }

Property Value

string

The header CSS class applied to header cell.

HeaderTemplate

Gets or sets the header template.

[Parameter]
public RenderFragment HeaderTemplate { get; set; }

Property Value

RenderFragment

The header template.

HeaderTooltip

Gets or sets the header tooltip.

[Parameter]
public string HeaderTooltip { get; set; }

Property Value

string

The header tooltip.

IsInEditMode

Allows the column to override whether or not this column's the EditTemplate is visible at runtime.

[Parameter]
public Func<string, TItem, bool> IsInEditMode { get; set; }

Property Value

Func<string, TItem, bool>

LogicalFilterOperator

Gets or sets the logical filter operator.

[Parameter]
public LogicalFilterOperator LogicalFilterOperator { get; set; }

Property Value

LogicalFilterOperator

The logical filter operator.

MinWidth

Gets or sets the min-width.

[Parameter]
public string MinWidth { get; set; }

Property Value

string

The min-width.

OrderIndex

Gets or sets the order index.

[Parameter]
public int? OrderIndex { get; set; }

Property Value

int?

The order index.

Parent

Gets or sets the parent column.

[CascadingParameter]
public RadzenDataGridColumn<TItem> Parent { get; set; }

Property Value

RadzenDataGridColumn<TItem>

The parent column.

Pickable

Gets or sets a value indicating whether this RadzenDataGridColumn<TItem> is pickable - listed when DataGrid AllowColumnPicking is set to true.

[Parameter]
public bool Pickable { get; set; }

Property Value

bool

true if pickable; otherwise, false.

Property

Gets or sets the property name.

[Parameter]
public string Property { get; set; }

Property Value

string

The property name.

Reorderable

Gets or sets a value indicating whether this RadzenDataGridColumn<TItem> is reorderable.

[Parameter]
public bool Reorderable { get; set; }

Property Value

bool

true if reorderable; otherwise, false.

Resizable

Gets or sets a value indicating whether this RadzenDataGridColumn<TItem> is resizable.

[Parameter]
public bool Resizable { get; set; }

Property Value

bool

true if resizable; otherwise, false.

SecondFilterOperator

Gets or sets the second filter operator.

[Parameter]
public FilterOperator SecondFilterOperator { get; set; }

Property Value

FilterOperator

The second filter operator.

SecondFilterValue

Gets or sets the second filter value.

[Parameter]
public object SecondFilterValue { get; set; }

Property Value

object

The second filter value.

SecondFilterValueTemplate

Gets or sets the second filter value template.

[Parameter]
public RenderFragment<RadzenDataGridColumn<TItem>> SecondFilterValueTemplate { get; set; }

Property Value

RenderFragment<RadzenDataGridColumn<TItem>>

The second filter value template.

SortOrder

Gets or sets the sort order.

[Parameter]
public SortOrder? SortOrder { get; set; }

Property Value

SortOrder?

The sort order.

SortProperty

Gets or sets the sort property name.

[Parameter]
public string SortProperty { get; set; }

Property Value

string

The sort property name.

Sortable

Gets or sets a value indicating whether this RadzenDataGridColumn<TItem> is sortable.

[Parameter]
public bool Sortable { get; set; }

Property Value

bool

true if sortable; otherwise, false.

Template

Gets or sets the template.

[Parameter]
public RenderFragment<TItem> Template { get; set; }

Property Value

RenderFragment<TItem>

The template.

TextAlign

Gets or sets the text align.

[Parameter]
public TextAlign TextAlign { get; set; }

Property Value

TextAlign

The text align.

Title

Gets or sets the title.

[Parameter]
public string Title { get; set; }

Property Value

string

The title.

Type

Gets or sets the data type.

[Parameter]
public Type Type { get; set; }

Property Value

Type

The data type.

UniqueID

Gets or sets the unique identifier.

[Parameter]
public string UniqueID { get; set; }

Property Value

string

The unique identifier.

Visible

Gets or sets a value indicating whether this RadzenDataGridColumn<TItem> is visible.

[Parameter]
public bool Visible { get; set; }

Property Value

bool

true if visible; otherwise, false.

Width

Gets or sets the width.

[Parameter]
public string Width { get; set; }

Property Value

string

The width.

Methods

BuildRenderTree(RenderTreeBuilder)

protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder RenderTreeBuilder

ClearFilters()

Sets to default column filter values and operators.

public void ClearFilters()

CloseFilter()

Closes this column filter popup.

public Task CloseFilter()

Returns

Task

Dispose()

Disposes this instance.

public void Dispose()

GetColumnODataFilter(bool)

Gets an OData expression to filter by this column.

public string GetColumnODataFilter(bool second = false)

Parameters

second bool

Whether to use SecondFilterValue instead of FilterValue

Returns

string

An OData expression to filter by this column.

GetColumnODataFilter(object, FilterOperator)

Gets an OData expression to filter by this column.

protected virtual string GetColumnODataFilter(object filterValue, FilterOperator filterOperator)

Parameters

filterValue object

The specific value to filter by

filterOperator FilterOperator

The operator used to compare to filterValue

Returns

string

An OData expression to filter by this column.

GetCustomFilterExpression()

Get custom filter linq.

public string GetCustomFilterExpression()

Returns

string

GetFilterOperator()

Get column filter operator.

public FilterOperator GetFilterOperator()

Returns

FilterOperator

GetFilterOperatorText(FilterOperator)

Get filter operator text

public string GetFilterOperatorText(FilterOperator filterOperator)

Parameters

filterOperator FilterOperator

Returns

string

GetFilterOperators()

Get possible column filter operators.

public virtual IEnumerable<FilterOperator> GetFilterOperators()

Returns

IEnumerable<FilterOperator>

GetFilterPlaceholder()

Gets the filter placeholder.

public string GetFilterPlaceholder()

Returns

string

System.String.

GetFilterProperty()

Gets the filter property.

public string GetFilterProperty()

Returns

string

System.String.

GetFilterValue()

Get column filter value.

public object GetFilterValue()

Returns

object

GetGroupProperty()

Gets the group property.

public string GetGroupProperty()

Returns

string

System.String.

GetLogicalFilterOperator()

Get column logical filter operator.

public LogicalFilterOperator GetLogicalFilterOperator()

Returns

LogicalFilterOperator

GetOrderIndex()

Gets the order index.

public int? GetOrderIndex()

Returns

int?

GetSecondFilterOperator()

Get column second filter operator.

public FilterOperator GetSecondFilterOperator()

Returns

FilterOperator

GetSecondFilterValue()

Get column second filter value.

public object GetSecondFilterValue()

Returns

object

GetSortIndex()

Gets the column sort descriptor index indicating order of applied column sort in case of multiple sorting.

public int? GetSortIndex()

Returns

int?

GetSortOrder()

Get column sort order.

public SortOrder? GetSortOrder()

Returns

SortOrder?

GetSortProperty()

Gets the sort property.

public string GetSortProperty()

Returns

string

System.String.

GetStyle(bool, bool, bool)

Gets the cell style.

public virtual string GetStyle(bool forCell = false, bool isHeaderOrFooterCell = false, bool isForCol = false)

Parameters

forCell bool

if set to true [for cell].

isHeaderOrFooterCell bool

if set to true [is header or footer cell].

isForCol bool

if set to true [is for col element].

Returns

string

System.String.

GetTitle()

Gets the column title.

public string GetTitle()

Returns

string

System.String.

GetValue(TItem)

Gets the value for specified item.

public virtual object GetValue(TItem item)

Parameters

item TItem

The item.

Returns

object

System.Object.

GetVisible()

Gets if the column is visible or not.

public bool GetVisible()

Returns

bool

System.Boolean.

GetWidth()

Get column width.

public string GetWidth()

Returns

string

OnInitialized()

Called when initialized.

protected override void OnInitialized()

SetCustomFilterExpression(string)

Set column custom filter linq.

public void SetCustomFilterExpression(string value)

Parameters

value string

SetCustomFilterExpressionAsync(string)

Set column custom filter linq and reload grid.

public Task SetCustomFilterExpressionAsync(string value)

Parameters

value string

Filter value.

Returns

Task

SetFilterOperator(FilterOperator?)

Set column filter operator.

public void SetFilterOperator(FilterOperator? value)

Parameters

value FilterOperator?

SetFilterValue(object, bool)

Set column filter value.

public void SetFilterValue(object value, bool isFirst = true)

Parameters

value object
isFirst bool

SetFilterValueAsync(object, bool)

Set column filter value and reload grid.

public Task SetFilterValueAsync(object value, bool isFirst = true)

Parameters

value object

Filter value.

isFirst bool

true if FilterValue; false for SecondFilterValue

Returns

Task

SetLogicalFilterOperator(LogicalFilterOperator)

Set column second logical operator.

public void SetLogicalFilterOperator(LogicalFilterOperator value)

Parameters

value LogicalFilterOperator

SetParametersAsync(ParameterView)

Set parameters as an asynchronous operation.

public override Task SetParametersAsync(ParameterView parameters)

Parameters

parameters ParameterView

The parameters.

Returns

Task

A Task representing the asynchronous operation.

SetSecondFilterOperator(FilterOperator?)

Set column second filter operator.

public void SetSecondFilterOperator(FilterOperator? value)

Parameters

value FilterOperator?

SetTitle(string)

Sets the column title.

public void SetTitle(string value)

Parameters

value string

SetWidth(string)

Set column width.

public void SetWidth(string value)

Parameters

value string

ShowTimeForDateTimeFilter()

Gets value indicating if the user can specify time in DateTime column filter.

public virtual bool ShowTimeForDateTimeFilter()

Returns

bool

ShowUpDownForNumericFilter()

Gets value indicating if up and down buttons are displayed in numeric column filter.

public virtual bool ShowUpDownForNumericFilter()

Returns

bool