Class TextColumn
Represents a column for showing text values in a Trinity table.
public class TextColumn : TrinityColumn<TextColumn, string>, ITrinityColumn, ITrinityComponent
- Inheritance
-
TextColumn
- Implements
- Inherited Members
Constructors
TextColumn(string)
public TextColumn(string columnName)
Parameters
columnName
string
Properties
ComponentName
The component name in the front-end side.
public override string ComponentName { get; }
Property Value
Currency
Gets or sets the currency code to be displayed in the column.
public string? Currency { get; protected set; }
Property Value
- string
The currency code to be displayed in the column.
DateTimeFormat
Gets the date/time format.
public string? DateTimeFormat { get; protected set; }
Property Value
OpenUrlInNewTab
Gets a value indicating whether to open the URL in a new tab.
public bool OpenUrlInNewTab { get; protected set; }
Property Value
TimeAgo
Gets or sets a value indicating whether the column should be displayed as time ago.
public bool TimeAgo { get; protected set; }
Property Value
- bool
true
if the column should be displayed as time ago; otherwise,false
.
Url
Gets a value indicating whether the column value is a URL.
public bool Url { get; protected set; }
Property Value
UrlCallback
The URL callback function.
protected TrinityColumn<TextColumn, string>.CallbackWithRecord<string>? UrlCallback { get; set; }
Property Value
- TrinityColumn<TextColumn, string>.CallbackWithRecord<string>
Methods
Format()
Formats the value of the column, if FormatUsingCallback defined will apply the callback function.
public override void Format()
SetAsCurrency(string)
Sets the column to display the specified currency code.
public TextColumn SetAsCurrency(string currency = "USD")
Parameters
currency
stringThe currency code to be displayed in the column.
Returns
- TextColumn
The current instance of the TextColumn.
SetAsDateTime(string)
Sets the column value as a date/time.
public TextColumn SetAsDateTime(string format = "yyyy-MM-dd HH:mm:ss")
Parameters
format
stringThe date/time format.
Returns
- TextColumn
The current instance of the TextColumn.
SetAsTimeAgo(bool)
Sets the column to be displayed as time ago.
public TextColumn SetAsTimeAgo(bool timeAgo = true)
Parameters
timeAgo
boolA value indicating whether the column should be displayed as time ago.
Returns
- TextColumn
The current instance of the TextColumn.
SetAsUrl(CallbackWithRecord<string>, bool)
Sets the column value as a URL.
public TextColumn SetAsUrl(TrinityColumn<TextColumn, string>.CallbackWithRecord<string> callback, bool openUrlInNewTab = false)
Parameters
callback
TrinityColumn<TextColumn, string>.CallbackWithRecord<string>The URL callback function.
openUrlInNewTab
boolWhether to open the URL in a new tab.
Returns
- TextColumn
The current instance of the TextColumn.
SetLimit(int)
Sets the maximum number of characters to be displayed in the column value.
public TextColumn SetLimit(int limit)
Parameters
limit
intThe maximum number of characters.
Returns
- TextColumn
The current instance of the TextColumn.
SetWordsCount(int)
Sets the maximum number of words to be displayed in the column value.
public TextColumn SetWordsCount(int words)
Parameters
words
intThe maximum number of words.
Returns
- TextColumn
The current instance of the TextColumn.