diff --git a/docs/en/UI/Blazor/Data-Table-Column-Extensions.md b/docs/en/UI/Blazor/Data-Table-Column-Extensions.md index ebb2f27cbf..f61ba49457 100644 --- a/docs/en/UI/Blazor/Data-Table-Column-Extensions.md +++ b/docs/en/UI/Blazor/Data-Table-Column-Extensions.md @@ -73,6 +73,7 @@ This section explains how to customize data table columns using the properties i * `Sortable`: A boolean field indicating whether the column is sortable or not. * `DisplayFormat`: You can specify a custom format for the column. * `DisplayFormatProvider` : You can provide a custom `IFormatProvider` for the column. Default value is `CultureInfo.CurrentCulture`. +* `Visible`: A boolean field indicating whether the column is visible or not. ## Rendering Custom Components In The Data Table Columns diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Extensibility/TableColumns/TableColumn.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Extensibility/TableColumns/TableColumn.cs index efd1d9320b..89cdb33729 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Extensibility/TableColumns/TableColumn.cs +++ b/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Extensibility/TableColumns/TableColumn.cs @@ -24,6 +24,8 @@ public class TableColumn public Func? ValueConverter { get; set; } public bool Sortable { get; set; } + + public bool Visible { get; set; } = true; public TableColumn() { diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/AbpExtensibleDataGrid.razor b/framework/src/Volo.Abp.BlazoriseUI/Components/AbpExtensibleDataGrid.razor index b38f4afaa9..ed9c532e49 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/Components/AbpExtensibleDataGrid.razor +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/AbpExtensibleDataGrid.razor @@ -74,7 +74,7 @@ { @if (column.ValueConverter == null) { - + @RenderCustomTableColumnComponent(column.Component, context) @@ -82,7 +82,7 @@ } else { - + @RenderCustomTableColumnComponent(column.Component, context) @@ -100,14 +100,16 @@ Caption="@column.Title" Sortable="@column.Sortable" DisplayFormat="@column.DisplayFormat" - DisplayFormatProvider="@column.DisplayFormatProvider"/> + DisplayFormatProvider="@column.DisplayFormatProvider" + Displayable="column.Visible"/> } else { + Sortable="@column.Sortable" + Displayable="column.Visible"> @(GetConvertedFieldValue(context, column)) @@ -116,7 +118,7 @@ } else { - + @{ var entity = context as IHasExtraProperties;