Skip to content

Commit

Permalink
Fixed Header - updates
Browse files Browse the repository at this point in the history
  • Loading branch information
gvreddy04 committed Oct 11, 2023
1 parent cb5bf27 commit ae90ce1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Grid @ref="grid"
TItem="Employee4"
AllowFixedHeader="true"
Class="table table-hover table-bordered"
DataProvider="EmployeesDataProvider"
FixedHeader="true"
Height="350"
Responsive="true"
Unit="Unit.px">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<Grid @ref="grid"
TItem="Employee4"
AllowFiltering="true"
AllowFixedHeader="true"
Class="table table-hover table-bordered"
DataProvider="EmployeesDataProvider"
FixedHeader="true"
HeaderRowCssClass="bg-dark text-white border-bottom-0"
Height="350"
Responsive="true"
Expand Down
16 changes: 8 additions & 8 deletions blazorbootstrap/Components/Grid/Grid.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public partial class Grid<TItem> : BlazorBootstrapComponentBase

protected override void BuildClasses(CssClassBuilder builder)
{
builder.Append(BootstrapClassProvider.TableSticky(), AllowFixedHeader);
builder.Append(BootstrapClassProvider.TableSticky(), FixedHeader);

base.BuildClasses(builder);
}
Expand Down Expand Up @@ -121,7 +121,7 @@ private string GetGridParentStyle()
{
var styleAttributes = new HashSet<string>();

if (AllowFixedHeader)
if (FixedHeader)
{
styleAttributes.Add($"height:{Height.ToString(CultureInfo.InvariantCulture)}{Unit}");
}
Expand Down Expand Up @@ -546,12 +546,6 @@ private void SetFilters(IEnumerable<FilterItem> filterItems)
[Parameter]
public bool AllowFiltering { get; set; }

/// <summary>
/// Gets or sets the grid fixed header.
/// </summary>
[Parameter]
public bool AllowFixedHeader { get; set; }

/// <summary>
/// Gets or sets the grid paging.
/// </summary>
Expand Down Expand Up @@ -631,6 +625,12 @@ private void SetFilters(IEnumerable<FilterItem> filterItems)
[Parameter]
public GridFiltersTranslationDelegate FiltersTranslationProvider { get; set; } = default!;

/// <summary>
/// Gets or sets the grid fixed header.
/// </summary>
[Parameter]
public bool FixedHeader { get; set; }

private string gridParentStyle => GetGridParentStyle();

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion blazorbootstrap/wwwroot/blazor.bootstrap.css
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ table button.dropdown-toggle.bb-grid-filter::after {
padding: .375rem;
}

/* grid - sticky header */
/* grid - fixed header */
.bb-table-sticky {
border-collapse: collapse;
border-spacing: 0;
Expand Down

0 comments on commit ae90ce1

Please sign in to comment.