Skip to content

Issue With DataGridDisplayMode.Table #3741

@grumpykiwi

Description

@grumpykiwi

If I set my datagrid to use grid as the mode, everything displays fine

Image

If I change to table mode, the column headers and filters all lose their place

Image

I have tried all sorts of combinations but cant figure out why this is happening.

I am a CSS luddite BTW.

'''

<FluentDataGrid TGridItem="Timesheet" DisplayMode="DataGridDisplayMode.Table"
				ResizableColumns="false"
				HeaderCellAsButtonWithMenu="false"
				@ref="MyGrid"
				ShowHover="true"
				Loading="@IsLoadingData"
				Items="FilteredTimesheets"
				Style="width: 100%;"
				Pagination="@Pagination">
		
	<TemplateColumn Title="#" Align="Align.Start" Width="55px">
		<ChildContent>
			<FluentTooltip Anchor="@context.RecordNo.ToString()" Position="TooltipPosition.Right">Approval History</FluentTooltip>
			<FluentIcon id="@context.RecordNo.ToString()" OnClick="@(() => ShowHistory(context.RecordNo.Value))" value="@(FontAwesome.Icon("fa-circle-info", "#000000d9", FontAwesome.FontAwesomeIconSize.Large))" />
		</ChildContent>
	</TemplateColumn>
	<TemplateColumn Title="Begin Date" Align="Align.Start">
		<ChildContent>
			@context.BeginDate.ToShortDateString()
		</ChildContent>
		<ColumnOptions>
			<div class="search-box">
				<FluentDatePicker @bind-Value="BeginDateFilter" @bind-Value:after="@OnSearch"
								  ShowWeekNumbers="false"
								  ShowTodayButton="false"
								  ShowClearButton="true"
								  ShowGoToTodayButton="false"
								  ShowMonthPicker="false"
								  ShowYearPicker="false"
								  ShowTimePicker="false"
								  ShowCalendarButton="false"
								  ShowDayPicker="true"
								  ShowDateInput="false" />
				<FluentButton Appearance="Appearance.Outline" @onclick="ClearBeginDate">Clear</FluentButton> 
			</div>

		</ColumnOptions>
	</TemplateColumn>
	<TemplateColumn Title="End Date" Align="Align.Start">
		<ChildContent>
			@context.EndDate.ToShortDateString()
		</ChildContent>
		<ColumnOptions>
			<div class="search-box">
				<FluentDatePicker @bind-Value="EndDateFilter" @bind-Value:after="@OnSearch"
								  ShowWeekNumbers="false"
								  ShowTodayButton="false"
								  ShowClearButton="true"
								  ShowGoToTodayButton="false"
								  ShowMonthPicker="false"
								  ShowYearPicker="false"
								  ShowTimePicker="false"
								  ShowCalendarButton="false"
								  ShowDayPicker="true"
								  ShowDateInput="false" />
				<FluentButton Appearance="Appearance.Outline" @onclick="ClearEndDate">Clear</FluentButton> 
			</div>
		</ColumnOptions>

	</TemplateColumn>
	<TemplateColumn Title="Description" Align="Align.Start">
		<ChildContent>
		@context.Description
		</ChildContent>
		<ColumnOptions>
			<div class="search-box">
				<FluentSearch type="search" Autofocus="true" Placeholder="Description" @bind-Value="EmployeeNameFilter"
				@bind-Value:after="OnSearch" Immediate="true" ImmediateDelay="500" />
			</div>
		</ColumnOptions>
	</TemplateColumn>
	<TemplateColumn Title="Employee" Align="Align.Start">
		<ChildContent>
			@context.EmployeeName
		</ChildContent>
		<ColumnOptions>
			<div class="search-box">
				<FluentSearch type="search" Autofocus="true" Placeholder="Employee Name" @bind-Value="EmployeeNameFilter"
				@bind-Value:after="OnSearch" Immediate="true" ImmediateDelay="500" />
			</div>
		</ColumnOptions>
	</TemplateColumn>
	<TemplateColumn Title="State" Align="Align.Start">
		<ChildContent>
			@context.State
		</ChildContent>
	</TemplateColumn>
	<TemplateColumn Title="Lines" Align="Align.Center">
		<ChildContent>
			@context.TimesheetEntries.Where(x => x.TimesheetKey == context.RecordNo).Count()
		</ChildContent>
	</TemplateColumn>
	<TemplateColumn Title="Hours" Align="Align.Center">
		@context.TimesheetEntries.Sum(x => x.Qty).ToString("N2")
	</TemplateColumn>
</FluentDataGrid>

'''

Any pointers in the right direction would be greatly appreciated.

It is entirely possible I am doing the whole filter column thing wrong which could be causing it.

Thanks

Mark

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions