Skip to content
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

[FluentDataGrid] Add column Width parameter #1902

Merged
merged 1 commit into from
Apr 21, 2024

Conversation

vnbaaij
Copy link
Collaborator

@vnbaaij vnbaaij commented Apr 20, 2024

Based on #1901. You can now do:

 <FluentDataGrid Items="@Data.People" Style="width: 500px;">
     <PropertyColumn Title="ID" Property="@(c => c.PersonId)" Sortable="true" Width="100px" />
     @if (showName)
     {
         <TemplateColumn Title="Name" Width="200px">
             <strong>@context.LastName</strong>, @context.FirstName
         </TemplateColumn>
     }
     @if (showBirthDate)
     {
         <PropertyColumn Title="Birth date"
                         Property="@(c => c.BirthDate)"
                         Format="yyyy-MM-dd"
                         Sortable="true"
                         Width="200px"/>
     }
 </FluentDataGrid>

instead of using GridTemplateColumns

@vnbaaij vnbaaij added the improvement A non-feature-adding improvement label Apr 20, 2024
@vnbaaij vnbaaij added this to the v4.6.2 milestone Apr 20, 2024
@vnbaaij vnbaaij requested a review from dvoituron as a code owner April 20, 2024 19:31
Copy link

github-actions bot commented Apr 20, 2024

✅ All tests passed successfully

Details on your Workflow / Core Tests page.

Copy link

github-actions bot commented Apr 20, 2024

Summary - Unit Tests Code Coverage

Summary
Generated on: 4/21/2024 - 8:57:00 AM
Coverage date: 4/21/2024 - 8:56:52 AM
Parser: Cobertura
Assemblies: 1
Classes: 229
Files: 337
Line coverage: 51.5% (3940 of 7636)
Covered lines: 3940
Uncovered lines: 3696
Coverable lines: 7636
Total lines: 26386
Branch coverage: 44.1% (1853 of 4197)
Covered branches: 1853
Total branches: 4197
Method coverage: Feature is only available for sponsors
Tag: 197_8771480449

Coverage

Microsoft.FluentUI.AspNetCore.Components - 51.5%
Name Line Branch
Microsoft.FluentUI.AspNetCore.Components 51.5% 44.1%
Microsoft.FluentUI.AspNetCore.Components.AccordionChangeEventArgs 0%
Microsoft.FluentUI.AspNetCore.Components.ActionButton`1 50%
Microsoft.FluentUI.AspNetCore.Components.ActionLink`1 0%
Microsoft.FluentUI.AspNetCore.Components.AdditionalAttributesExtensions 100% 100%
Microsoft.FluentUI.AspNetCore.Components.BooleanExtensions 100% 50%
Microsoft.FluentUI.AspNetCore.Components.CalendarExtended 95% 86.6%
Microsoft.FluentUI.AspNetCore.Components.CalendarTitles 87% 76.6%
Microsoft.FluentUI.AspNetCore.Components.CheckboxChangeEventArgs 50%
Microsoft.FluentUI.AspNetCore.Components.ColumnBase`1 0% 0%
Microsoft.FluentUI.AspNetCore.Components.CommunicationToast 0% 0%
Microsoft.FluentUI.AspNetCore.Components.CommunicationToastContent 0%
Microsoft.FluentUI.AspNetCore.Components.ComponentParameters 16.6% 0%
Microsoft.FluentUI.AspNetCore.Components.Components.Dialog.ContentComponent
s.RenderFragmentDialog
100%
Microsoft.FluentUI.AspNetCore.Components.Components.Tooltip.TooltipGlobalOp
tions
0%
Microsoft.FluentUI.AspNetCore.Components.Components.Tooltip.TooltipOptions 0%
Microsoft.FluentUI.AspNetCore.Components.Components.Tooltip.TooltipService 0% 0%
Microsoft.FluentUI.AspNetCore.Components.CountdownTimer 0% 0%
Microsoft.FluentUI.AspNetCore.Components.DataGrid.Infrastructure.AsyncQuery
ExecutorSupplier
0% 0%
Microsoft.FluentUI.AspNetCore.Components.DataGrid.Infrastructure.ColumnsCol
lectedNotifier`1
0% 0%
Microsoft.FluentUI.AspNetCore.Components.DataGrid.Infrastructure.Defer 0%
Microsoft.FluentUI.AspNetCore.Components.DataGrid.Infrastructure.DisplayAtt
ributeExtensions
0% 0%
Microsoft.FluentUI.AspNetCore.Components.DataGrid.Infrastructure.InternalGr
idContext`1
0% 0%
Microsoft.FluentUI.AspNetCore.Components.DataGridCellFocusEventArgs 0%
Microsoft.FluentUI.AspNetCore.Components.DataGridRowFocusEventArgs 0%
Microsoft.FluentUI.AspNetCore.Components.DateTimeExtensions 83.8% 85%
Microsoft.FluentUI.AspNetCore.Components.DialogEventArgs 0%
Microsoft.FluentUI.AspNetCore.Components.DialogInstance 92.3% 75%
Microsoft.FluentUI.AspNetCore.Components.DialogParameters 92.3%
Microsoft.FluentUI.AspNetCore.Components.DialogParameters`1 0%
Microsoft.FluentUI.AspNetCore.Components.DialogReference 33.3% 0%
Microsoft.FluentUI.AspNetCore.Components.DialogResult 0% 0%
Microsoft.FluentUI.AspNetCore.Components.DialogService 3% 3.3%
Microsoft.FluentUI.AspNetCore.Components.Emoji 0% 0%
Microsoft.FluentUI.AspNetCore.Components.EmojiCompress 0% 0%
Microsoft.FluentUI.AspNetCore.Components.EmojiInfo 0%
Microsoft.FluentUI.AspNetCore.Components.EnumExtensions 84.6% 75%
Microsoft.FluentUI.AspNetCore.Components.FluentAccessibilityStatus 0% 0%
Microsoft.FluentUI.AspNetCore.Components.FluentAccordion 52.3% 0%
Microsoft.FluentUI.AspNetCore.Components.FluentAccordionItem 73.9% 35.7%
Microsoft.FluentUI.AspNetCore.Components.FluentAnchor 88.8% 67.8%
Microsoft.FluentUI.AspNetCore.Components.FluentAnchoredRegion 86% 60%
Microsoft.FluentUI.AspNetCore.Components.FluentAppBar 57.7% 41.1%
Microsoft.FluentUI.AspNetCore.Components.FluentAppBarItem 83.8% 66.6%
Microsoft.FluentUI.AspNetCore.Components.FluentAutocomplete`1 80.7% 66.6%
Microsoft.FluentUI.AspNetCore.Components.FluentBadge 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentBodyContent 100%
Microsoft.FluentUI.AspNetCore.Components.FluentBreadcrumb 100%
Microsoft.FluentUI.AspNetCore.Components.FluentBreadcrumbItem 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentButton 86.1% 64%
Microsoft.FluentUI.AspNetCore.Components.FluentCalendar 90% 83.3%
Microsoft.FluentUI.AspNetCore.Components.FluentCalendarBase 100% 94.4%
Microsoft.FluentUI.AspNetCore.Components.FluentCalendarDay 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentCalendarMonth 100% 66.6%
Microsoft.FluentUI.AspNetCore.Components.FluentCalendarYear 90.9% 60%
Microsoft.FluentUI.AspNetCore.Components.FluentCard 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentCheckbox 95.7% 90.3%
Microsoft.FluentUI.AspNetCore.Components.FluentCollapsibleRegion 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentCombobox`1 51.8% 31.5%
Microsoft.FluentUI.AspNetCore.Components.FluentComponentBase 90.9% 50%
Microsoft.FluentUI.AspNetCore.Components.FluentCounterBadge 92.3% 86.5%
Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid`1 0% 0%
Microsoft.FluentUI.AspNetCore.Components.FluentDataGridCell`1 0%
Microsoft.FluentUI.AspNetCore.Components.FluentDataGridRow`1 0% 0%
Microsoft.FluentUI.AspNetCore.Components.FluentDatePicker 74% 37.5%
Microsoft.FluentUI.AspNetCore.Components.FluentDesignSystemProvider 100% 50%
Microsoft.FluentUI.AspNetCore.Components.FluentDesignTheme 0% 0%
Microsoft.FluentUI.AspNetCore.Components.FluentDialog 61% 71%
Microsoft.FluentUI.AspNetCore.Components.FluentDialogBody 100%
Microsoft.FluentUI.AspNetCore.Components.FluentDialogFooter 66.6% 44.1%
Microsoft.FluentUI.AspNetCore.Components.FluentDialogHeader 82.6% 76.9%
Microsoft.FluentUI.AspNetCore.Components.FluentDialogProvider 38% 18.7%
Microsoft.FluentUI.AspNetCore.Components.FluentDivider 82.3% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentDragContainer`1 69.2%
Microsoft.FluentUI.AspNetCore.Components.FluentDragEventArgs`1 0%
Microsoft.FluentUI.AspNetCore.Components.FluentDropZone`1 22.2% 5%
Microsoft.FluentUI.AspNetCore.Components.FluentEditForm 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentEmoji`1 0% 0%
Microsoft.FluentUI.AspNetCore.Components.FluentFlipper 100%
Microsoft.FluentUI.AspNetCore.Components.FluentFooter 100%
Microsoft.FluentUI.AspNetCore.Components.FluentGrid 80% 50%
Microsoft.FluentUI.AspNetCore.Components.FluentGridItem 87.5% 82.5%
Microsoft.FluentUI.AspNetCore.Components.FluentHeader 100%
Microsoft.FluentUI.AspNetCore.Components.FluentHighlighter 80% 20%
Microsoft.FluentUI.AspNetCore.Components.FluentHorizontalScroll 51.8% 20%
Microsoft.FluentUI.AspNetCore.Components.FluentIcon`1 94.8% 93.3%
Microsoft.FluentUI.AspNetCore.Components.FluentInputBase`1 64.1% 57.5%
Microsoft.FluentUI.AspNetCore.Components.FluentInputExtensions 0% 0%
Microsoft.FluentUI.AspNetCore.Components.FluentInputFile 88.5% 76.6%
Microsoft.FluentUI.AspNetCore.Components.FluentInputFileBuffer 100%
Microsoft.FluentUI.AspNetCore.Components.FluentInputFileEventArgs 91.6%
Microsoft.FluentUI.AspNetCore.Components.FluentInputLabel 95.2% 88.8%
Microsoft.FluentUI.AspNetCore.Components.FluentKeyCode 97.7% 84.6%
Microsoft.FluentUI.AspNetCore.Components.FluentKeyCodeEventArgs 100% 83.3%
Microsoft.FluentUI.AspNetCore.Components.FluentKeyCodeProvider 57.1% 0%
Microsoft.FluentUI.AspNetCore.Components.FluentLabel 58.6% 21.4%
Microsoft.FluentUI.AspNetCore.Components.FluentLayout 100%
Microsoft.FluentUI.AspNetCore.Components.FluentListbox`1 0% 0%
Microsoft.FluentUI.AspNetCore.Components.FluentMain 100%
Microsoft.FluentUI.AspNetCore.Components.FluentMainLayout 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentMenu 38.8% 41.6%
Microsoft.FluentUI.AspNetCore.Components.FluentMenuButton 59.3% 8.3%
Microsoft.FluentUI.AspNetCore.Components.FluentMenuItem 0% 0%
Microsoft.FluentUI.AspNetCore.Components.FluentMessageBar 50% 22.8%
Microsoft.FluentUI.AspNetCore.Components.FluentMessageBarProvider 82.3% 66.6%
Microsoft.FluentUI.AspNetCore.Components.FluentMultiSplitter 81.1% 66.6%
Microsoft.FluentUI.AspNetCore.Components.FluentMultiSplitterEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.FluentMultiSplitterPane 95.7% 87.5%
Microsoft.FluentUI.AspNetCore.Components.FluentMultiSplitterResizeEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.FluentNavBase 50% 0%
Microsoft.FluentUI.AspNetCore.Components.FluentNavGroup 62.3% 42.3%
Microsoft.FluentUI.AspNetCore.Components.FluentNavLink 88% 50%
Microsoft.FluentUI.AspNetCore.Components.FluentNavMenu 59.1% 40%
Microsoft.FluentUI.AspNetCore.Components.FluentNavMenuGroup 0% 0%
Microsoft.FluentUI.AspNetCore.Components.FluentNavMenuItemBase 0% 0%
Microsoft.FluentUI.AspNetCore.Components.FluentNavMenuLink 0% 0%
Microsoft.FluentUI.AspNetCore.Components.FluentNavMenuTree 0% 0%
Microsoft.FluentUI.AspNetCore.Components.FluentNumberField`1 60.4% 47.2%
Microsoft.FluentUI.AspNetCore.Components.FluentOption`1 52.9% 33.3%
Microsoft.FluentUI.AspNetCore.Components.FluentOverflow 0% 0%
Microsoft.FluentUI.AspNetCore.Components.FluentOverflowItem 0% 0%
Microsoft.FluentUI.AspNetCore.Components.FluentOverlay 70.5% 50%
Microsoft.FluentUI.AspNetCore.Components.FluentPageScript 100%
Microsoft.FluentUI.AspNetCore.Components.FluentPaginator 0% 0%
Microsoft.FluentUI.AspNetCore.Components.FluentPersona 100% 84.3%
Microsoft.FluentUI.AspNetCore.Components.FluentPopover 76% 65.9%
Microsoft.FluentUI.AspNetCore.Components.FluentPresenceBadge 60.9% 29.1%
Microsoft.FluentUI.AspNetCore.Components.FluentProfileMenu 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentProgress 79% 68.1%
Microsoft.FluentUI.AspNetCore.Components.FluentProgressRing 97.2% 92.8%
Microsoft.FluentUI.AspNetCore.Components.FluentPullToRefresh 94% 89.2%
Microsoft.FluentUI.AspNetCore.Components.FluentRadio`1 0% 0%
Microsoft.FluentUI.AspNetCore.Components.FluentRadioContext 70% 0%
Microsoft.FluentUI.AspNetCore.Components.FluentRadioGroup`1 80% 31.2%
Microsoft.FluentUI.AspNetCore.Components.FluentSearch 0% 0%
Microsoft.FluentUI.AspNetCore.Components.FluentSelect`1 0%
Microsoft.FluentUI.AspNetCore.Components.FluentSkeleton 52.9% 50%
Microsoft.FluentUI.AspNetCore.Components.FluentSlider`1 56% 33.3%
Microsoft.FluentUI.AspNetCore.Components.FluentSliderLabel`1 65.5% 30%
Microsoft.FluentUI.AspNetCore.Components.FluentSortableList`1 68.2% 50%
Microsoft.FluentUI.AspNetCore.Components.FluentSortableListEventArgs 0%
Microsoft.FluentUI.AspNetCore.Components.FluentSpacer 100% 50%
Microsoft.FluentUI.AspNetCore.Components.FluentSplashScreen 0% 0%
Microsoft.FluentUI.AspNetCore.Components.FluentSplitter 70.7% 40%
Microsoft.FluentUI.AspNetCore.Components.FluentStack 90.4% 60%
Microsoft.FluentUI.AspNetCore.Components.FluentSwitch 77.7% 50%
Microsoft.FluentUI.AspNetCore.Components.FluentTab 0% 0%
Microsoft.FluentUI.AspNetCore.Components.FluentTabs 0% 0%
Microsoft.FluentUI.AspNetCore.Components.FluentTextArea 80%
Microsoft.FluentUI.AspNetCore.Components.FluentTextField 86.6% 60%
Microsoft.FluentUI.AspNetCore.Components.FluentTimePicker 100% 75%
Microsoft.FluentUI.AspNetCore.Components.FluentToast 0% 0%
Microsoft.FluentUI.AspNetCore.Components.FluentToastProvider 0% 0%
Microsoft.FluentUI.AspNetCore.Components.FluentToolbar 100%
Microsoft.FluentUI.AspNetCore.Components.FluentTooltip 60.7% 47.6%
Microsoft.FluentUI.AspNetCore.Components.FluentTooltipProvider 0% 0%
Microsoft.FluentUI.AspNetCore.Components.FluentTreeItem 0% 0%
Microsoft.FluentUI.AspNetCore.Components.FluentTreeView 22.6% 0%
Microsoft.FluentUI.AspNetCore.Components.FluentValidationMessage`1 0% 0%
Microsoft.FluentUI.AspNetCore.Components.FluentValidationSummary 100% 87.5%
Microsoft.FluentUI.AspNetCore.Components.FluentWizard 93.5% 82.8%
Microsoft.FluentUI.AspNetCore.Components.FluentWizardStep 94.6% 83.8%
Microsoft.FluentUI.AspNetCore.Components.FluentWizardStepArgs 100%
Microsoft.FluentUI.AspNetCore.Components.FluentWizardStepChangeEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.GlobalState 33.3% 50%
Microsoft.FluentUI.AspNetCore.Components.GridItemsProviderRequest`1 0% 0%
Microsoft.FluentUI.AspNetCore.Components.GridItemsProviderResult 0%
Microsoft.FluentUI.AspNetCore.Components.GridItemsProviderResult`1 0%
Microsoft.FluentUI.AspNetCore.Components.GridSort`1 35.1% 25.9%
Microsoft.FluentUI.AspNetCore.Components.HorizontalScrollEventArgs 0%
Microsoft.FluentUI.AspNetCore.Components.Icon 81.3% 82.3%
Microsoft.FluentUI.AspNetCore.Components.IconFromImage 100%
Microsoft.FluentUI.AspNetCore.Components.IconInfo 100%
Microsoft.FluentUI.AspNetCore.Components.Identifier 66.6% 62.5%
Microsoft.FluentUI.AspNetCore.Components.IdentifierContext 66.6% 41.6%
Microsoft.FluentUI.AspNetCore.Components.INavMenuItemsOwner 0%
Microsoft.FluentUI.AspNetCore.Components.Infrastructure.EventCallbackSubscr
ibable`1
0% 0%
Microsoft.FluentUI.AspNetCore.Components.Infrastructure.EventCallbackSubscr
iber`1
0% 0%
Microsoft.FluentUI.AspNetCore.Components.InputHelpers`1 38.8% 31.6%
Microsoft.FluentUI.AspNetCore.Components.InternalDialogContext 80%
Microsoft.FluentUI.AspNetCore.Components.InternalListContext`1 60% 50%
Microsoft.FluentUI.AspNetCore.Components.InternalToastContext 0%
Microsoft.FluentUI.AspNetCore.Components.KeyCodeService 84.6% 50%
Microsoft.FluentUI.AspNetCore.Components.LibraryConfiguration 100%
Microsoft.FluentUI.AspNetCore.Components.ListComponentBase`1 50.2% 43.4%
Microsoft.FluentUI.AspNetCore.Components.LoadedEventArgs 0%
Microsoft.FluentUI.AspNetCore.Components.LuminanceChangedEventArgs 0%
Microsoft.FluentUI.AspNetCore.Components.MenuChangeEventArgs 0%
Microsoft.FluentUI.AspNetCore.Components.Message 50% 0%
Microsoft.FluentUI.AspNetCore.Components.MessageBox 50% 0%
Microsoft.FluentUI.AspNetCore.Components.MessageBoxContent 0%
Microsoft.FluentUI.AspNetCore.Components.MessageOptions 76.9%
Microsoft.FluentUI.AspNetCore.Components.MessageService 33% 26.9%
Microsoft.FluentUI.AspNetCore.Components.NavMenuActionArgs 0% 0%
Microsoft.FluentUI.AspNetCore.Components.OfficeColorUtilities 0%
Microsoft.FluentUI.AspNetCore.Components.Option`1 0%
Microsoft.FluentUI.AspNetCore.Components.OptionsSearchEventArgs`1 100%
Microsoft.FluentUI.AspNetCore.Components.OverflowItem 100%
Microsoft.FluentUI.AspNetCore.Components.PaginationState 0% 0%
Microsoft.FluentUI.AspNetCore.Components.ProgressFileDetails 100%
Microsoft.FluentUI.AspNetCore.Components.ProgressToast 0% 0%
Microsoft.FluentUI.AspNetCore.Components.ProgressToastContent 0%
Microsoft.FluentUI.AspNetCore.Components.PropertyColumn`2 0% 0%
Microsoft.FluentUI.AspNetCore.Components.Resources.TimeAgoResource 76.1% 100%
Microsoft.FluentUI.AspNetCore.Components.ServiceCollectionExtensions 78.5% 100%
Microsoft.FluentUI.AspNetCore.Components.SortedProperty 0%
Microsoft.FluentUI.AspNetCore.Components.SplashScreenContent 0% 0%
Microsoft.FluentUI.AspNetCore.Components.SplitterCollapsedEventArgs 0%
Microsoft.FluentUI.AspNetCore.Components.SplitterResizedEventArgs 0%
Microsoft.FluentUI.AspNetCore.Components.StandardLuminanceExtensions 0% 0%
Microsoft.FluentUI.AspNetCore.Components.StaticAssetServiceConfiguration 0% 0%
Microsoft.FluentUI.AspNetCore.Components.StringExtensions 0%
Microsoft.FluentUI.AspNetCore.Components.TabChangeEventArgs 0%
Microsoft.FluentUI.AspNetCore.Components.TemplateColumn`1 0% 0%
Microsoft.FluentUI.AspNetCore.Components.TimeAgoOptions 100%
Microsoft.FluentUI.AspNetCore.Components.ToastInstance 0% 0%
Microsoft.FluentUI.AspNetCore.Components.ToastParameters 0%
Microsoft.FluentUI.AspNetCore.Components.ToastParameters`1 0%
Microsoft.FluentUI.AspNetCore.Components.ToastResult 0% 0%
Microsoft.FluentUI.AspNetCore.Components.ToastService 0% 0%
Microsoft.FluentUI.AspNetCore.Components.TreeChangeEventArgs 0%
Microsoft.FluentUI.AspNetCore.Components.UploadedFileDetails 0%
Microsoft.FluentUI.AspNetCore.Components.Utilities.CssBuilder 100% 91.6%
Microsoft.FluentUI.AspNetCore.Components.Utilities.Debouncer 94.8% 37.5%
Microsoft.FluentUI.AspNetCore.Components.Utilities.InlineStyleBuilder 96.4% 87.5%
Microsoft.FluentUI.AspNetCore.Components.Utilities.JSModule 0% 0%
Microsoft.FluentUI.AspNetCore.Components.Utilities.Splitter 82.8% 81.8%
Microsoft.FluentUI.AspNetCore.Components.Utilities.StyleBuilder 100% 91.6%
Microsoft.FluentUI.AspNetCore.Components.ZIndex 100%
System.Text.RegularExpressions.Generated 72.5% 42.1%

@vnbaaij vnbaaij merged commit 1568fbf into dev Apr 21, 2024
3 checks passed
@vnbaaij vnbaaij deleted the users/vnbaaij/datagrid-columnwidth branch April 21, 2024 08:54
@vnbaaij vnbaaij modified the milestones: v4.6.2, v4.7.0 Apr 22, 2024
vnbaaij added a commit that referenced this pull request Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement A non-feature-adding improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants