-
Notifications
You must be signed in to change notification settings - Fork 543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace data grid column headers with custom template #5266
Replace data grid column headers with custom template #5266
Conversation
… column not sortable
…gle-pointer # Conflicts: # src/Aspire.Dashboard/Components/Controls/PropertyGrid.razor # src/Aspire.Dashboard/Components/Controls/ResourceDetails.razor
@dvoituron should we perhaps consider this to be our default behavior as well? |
The curved arrow button feels confusing. It seems to be a reset button, yes? Should it only be enabled when there is a value to reset? Otherwise, people will click on it and not see any change. Also, clicking the tick button closes the popup. I think that clicking the reset button should close the dialog as well. Edit: I think this feedback can be ignored if we go with +/- buttons. See below. |
I'm curious if there was a reason why you chose a text box compared to + and - buttons like FluentUI? https://www.fluentui-blazor.net/DataGrid It is easier to find the size you want by tapping those buttons compared to guessing with a pixel number. |
Discussion here indicates +/- are ok. |
@typeparam TItem | ||
@inject IStringLocalizer<ControlsStrings> Loc | ||
|
||
<FluentDataGrid Items="@Items" | ||
<FluentDataGrid ResizeLabel="@AspireFluentDataGridHeaderCell.GetResizeLabel(Loc)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I think there might be the opportunity to reduce the amount of change by having a custom FluentDataGrid type instead of custom columns. The custom grid type could loop through the columns and set HeaderCellItemTemplate = AspireFluentDataGridHeaderCell.RenderHeaderContent(Grid);
on all the columns.
However, that might create problems of its own if there are situations where that is wrong behavior. Custom columns that set the header is probably ok for now. It's verbose, but it gives us control.
Yes, it is a reset button (same as Shift+r key). |
We offer both as options for resizing. It is controlled by the |
Yes, I find it preferable to have a minimum of visual information on the grid headers. |
…gle-pointer # Conflicts: # src/Aspire.Dashboard/Components/Pages/Traces.razor
We don't own that resize UI. That's provided from fluentui-blazor. I changed it to |
I couldn't see how that behavior is anything but a bug in fluentui. I've been trying to figure it out, even setting the horizontal position explicitly to left or start doesn't change it. @vnbaaij for confirmation However, if there's no easy resolution, since this isn't a blocking bug - whereas we are on strict timelines for accessibility sev2s - we could still merge. |
Agree that it's not a blocking bug. But please create an issue in the fluentui repo. |
# Conflicts: # src/Aspire.Dashboard/Components/Pages/Metrics.razor
/azp run |
1 similar comment
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Build failed with a timeout of 100 seconds on downloading a file:
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Description
@vnbaaij graciously added the ability to resize columns via a UI to fluentui-blazor. However, this is done by adding a button to the column header cell, space which adds up when there are many columns in a grid. For example,

We are still required to have some way to toggle this UI, so I created two wrapper classes
FluentTemplateColumn
andFluentPropertyColumn
which set the header cell template to a button that, when clicked, opens a menu allowing the user to select betweenSort
andResize
- this UI concept is taken directly from the accessible data grid example provided here. The button is not aMenuButton
because we do not want to show the chevron (again, for space reasons).The resize ui (column options ui) is toggled if a cell is clicked that is not sortable, as can be seen in the recording below. Most changes are
Property/TemplateColumn
->AspireProperty/TemplateColumn
Screen.Recording.2024-08-12.at.11.28.47.AM.mov
Fixes #3364, fixes #3365
Checklist
<remarks />
and<code />
elements on your triple slash comments?