CommunityToolkit / WindowsCommunityToolkit

The Windows Community Toolkit is a collection of helpers, extensions, and custom controls. It simplifies and demonstrates common developer tasks building .NET apps with UWP and the Windows App SDK / WinUI 3 for Windows 10 and Windows 11. The toolkit is part of the .NET Foundation.
https://docs.microsoft.com/windows/communitytoolkit/
Other
5.89k stars 1.38k forks source link

DataGridCell content bounding box does not grow if content is longer than the initial cell width #4913

Open ErrorEater opened 1 year ago

ErrorEater commented 1 year ago

Describe the bug

If the initial cell width is smaller than the content length of a DataGridCell the content bounding box doesn't grow to show the whole content when the cell width is increased by the user.

Regression

No response

Reproducible in sample app?

Steps to reproduce

<controls:DataGrid x:Name="RunningTasks"
                   AutoGenerateColumns="False"
                   GridLinesVisibility="Horizontal"
                   HorizontalGridLinesBrush="Black"
                   ItemsSource="{x:Bind ViewModel.Source, Mode=OneWay}"
                   IsReadOnly="True"
                   SelectionMode="Single"
                   Height="160">
    <controls:DataGrid.Columns>
        <controls:DataGridTextColumn
            Binding="{Binding Points, Converter={StaticResource StringFormatConverter}, ConverterParameter='{}{0:N0}'}"
            Header="Points" />
    </controls:DataGrid.Columns>
</controls:DataGrid>

Expected behavior

If the cell width is 100px and its content's width is 200px and when the user expands the column to see the whole content the bounding box around the content should grow to 200px, towards the direction where it is aligned to, to show the whole content. Currently it stays at 100px and doesn't grow, truncates the content.

Screenshots

image

Windows Build Number

Other Windows Build number

No response

App minimum and target SDK version

Other SDK version

No response

Visual Studio Version

2022

Visual Studio Build Number

17.6.5

Device form factor

Desktop

Nuget packages

<ItemGroup>
    <PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.1" />
    <PackageReference Include="CommunityToolkit.WinUI.UI.Controls" Version="7.1.2" />
    <PackageReference Include="CommunityToolkit.WinUI.UI.Controls.DataGrid" Version="7.1.2" />
    <PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0-preview.6.23329.7" />
    <PackageReference Include="Microsoft.WindowsAppSDK" Version="1.4.230628000-preview1" />
    <PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.25387-preview" />
    <Manifest Include="$(ApplicationManifest)" />
</ItemGroup>

Additional context

No response

Help us help you

No.

ghost commented 1 year ago

Hello aliveli186, thank you for opening an issue with us!

I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback ๐Ÿ™Œ

ghost commented 1 year ago

This issue has been marked as "needs attention ๐Ÿ‘‹" due to no activity for 15 days. Please triage the issue so the fix can be established.

ghost commented 1 year ago

This issue has been marked as "needs attention ๐Ÿ‘‹" due to no activity for 15 days. Please triage the issue so the fix can be established.