Class ColumnConfigurationExtensions
Contains extension methods for ColumnConfiguration collection.
public static class ColumnConfigurationExtensions
- Inheritance
-
objectColumnConfigurationExtensions
Methods
AddColumn(IList<ColumnConfiguration>, string, string, bool, int, int, bool, bool, bool, SortTypeEnum?, Func<object, IDataContainer, string>, string, bool)
Adds the column to the collection.
public static IList<ColumnConfiguration> AddColumn(this IList<ColumnConfiguration> configuration, string name, string caption = null, bool visible = true, int minWidth = 8, int maxWidth = 100, bool searchable = false, bool localizable = false, bool sortable = true, SortTypeEnum? defaultSortDirection = null, Func<object, IDataContainer, string> formatter = null, string tooltip = null, bool tooltipAsHtml = false)
Parameters
configurationIList<ColumnConfiguration>Configuration collection.
namestringColumn name.
captionstringCaption.
visibleboolIndicates whether column is visible.
minWidthintIndicates minimal width of the column.
maxWidthintIndicates maximal width of the column.
searchableboolIndicates whether column is searchable.
localizableboolIndicates whether column value should be processed with localization macro resolver.
sortableboolIndicates whether column is sortable.
defaultSortDirectionSortTypeEnum?Default sort direction.
formatterFunc<object, IDataContainer, string>Column value formatter.
tooltipstringTooltip for column.
tooltipAsHtmlboolIndicates that tooltip is dangerously rendered as HTML.
Returns
- IList<ColumnConfiguration>
Remarks
If the corresponding column's type is System.DateTime or System.Nullable<System.DateTime>
the system ensures that Date and Time is transferred to the client along with a time zone information. However, if formatter
parameter is specified at the same time, the system assumes an intention that the column value should be formatted as a string.
AddComponentColumn(IList<ColumnConfiguration>, string, string, string, bool, int, int, bool, bool, bool, bool, SortTypeEnum?, Func<object, IDataContainer, string>, Func<object, IDataContainer, object>, string, bool)
Adds the column with named component to the collection.
public static IList<ColumnConfiguration> AddComponentColumn(this IList<ColumnConfiguration> configuration, string columnName, string componentKey, string caption = null, bool visible = true, int minWidth = 8, int maxWidth = 100, bool searchable = false, bool localizable = false, bool sortable = true, bool loadedExternally = false, SortTypeEnum? defaultSortDirection = null, Func<object, IDataContainer, string> formatter = null, Func<object, IDataContainer, object> modelRetriever = null, string tooltip = null, bool tooltipAsHtml = false)
Parameters
configurationIList<ColumnConfiguration>Configuration collection.
columnNamestringColumn name.
componentKeystringName of a front-end component.
captionstringCaption.
visibleboolIndicates whether column is visible.
minWidthintIndicates minimal width of the column.
maxWidthintIndicates maximal width of the column.
searchableboolIndicates whether column is searchable.
localizableboolIndicates whether column value should be processed with localization macro resolver.
sortableboolIndicates whether column is sortable.
loadedExternallyboolIndicates whether column is loaded by custom logic.
defaultSortDirectionSortTypeEnum?Default sort direction.
formatterFunc<object, IDataContainer, string>Column value formatter.
modelRetrieverFunc<object, IDataContainer, object>Function allowing to create client component model.
tooltipstringTooltip for column.
tooltipAsHtmlboolIndicates that tooltip is dangerously rendered as HTML.
Returns
- IList<ColumnConfiguration>
LocalizeColumns(IList<ColumnConfiguration>, string, ILocalizationService)
Localizes columns without caption based on resourceKeyPrefix and Name.
[Obsolete("The method will be removed in the next major version. Use ILocalizationService.GetString and full resource key in columns definition.")]
public static void LocalizeColumns(this IList<ColumnConfiguration> configuration, string resourceKeyPrefix, ILocalizationService localizationService)
Parameters
configurationIList<ColumnConfiguration>Configuration collection.
resourceKeyPrefixstringResource key prefix.
localizationServiceILocalizationServiceLocalization service.