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

WinUI 3 DataGrid (CommunityToolkit.WinUI.UI.Controls) - Resize of height is not working when user shrink or expand column #4967

Open
2 of 14 tasks
chiragpandya04 opened this issue Jan 17, 2024 · 4 comments
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior DataGrid 🔠 Issues on DataGrid control needs attention 👋 needs triage 🔍

Comments

@chiragpandya04
Copy link

Describe the bug

WinUI 3 DataGrid (CommunityToolkit.WinUI.UI.Controls) - Resize of height is not working when user shrink or expand column

image

image

<ctWinUI:DataGrid
x:Name="DataGrid"
AutoGenerateColumns="False"
CanUserSortColumns="True"
controls:Grid.Row="1"
GridLinesVisibility="All"
Sorting="DataGrid_Sorting">
ctWinUI:DataGrid.Resources

<Style x:Key="WrapText" TargetType="TextBlock">

</Style>
</ctWinUI:DataGrid.Resources>
ctWinUI:DataGrid.RowStyle

<Style TargetType="ctWinUI:DataGridRow"> </Style>

</ctWinUI:DataGrid.RowStyle>
ctWinUI:DataGrid.Columns
<ctWinUI:DataGridTextColumn
Binding="{Binding Rank}"
Header="Rank"
Tag="Rank" />
<ctWinUI:DataGridComboBoxColumn
Binding="{Binding Mountain}"
Header="Mountain"
Tag="Mountain" />
<ctWinUI:DataGridTextColumn
Binding="{Binding Height_m}"
Header="Height (m)"
Tag="Height_m" />
<ctWinUI:DataGridTextColumn
Binding="{Binding Range}"
Header="Range"
Tag="Range" />
<ctWinUI:DataGridTextColumn
Binding="{Binding Parent_mountain}"
ElementStyle="{StaticResource WrapText}"
Header="Parent Mountain"
Tag="Parent_mountain" />
</ctWinUI:DataGrid.Columns>
</ctWinUI:DataGrid>

public HomePage()
{
this.InitializeComponent();
this.Loaded += HomePage_Loaded;
}

private async void HomePage_Loaded(object sender, RoutedEventArgs e)
{
DataGrid.ItemsSource = await _dataSource.GetDataAsync();
DataGrid.Columns[0].SortDirection = ctWinUI.DataGridSortDirection.Ascending;

DataGrid.RowHeight = double.NaN;

}

Regression

No response

Reproducible in sample app?

  • This bug can be reproduced in the sample app.

Steps to reproduce

Already given

Expected behavior

When we have set Wrap data for any column and if user resize (shrink) column and then expand column. data grid is not refreshing its height based on content. hence so many blank spaces. Please refer my both snapshots.

Screenshots

image

image

Windows Build Number

  • Windows 10 1809 (Build 17763)
  • Windows 10 1903 (Build 18362)
  • Windows 10 1909 (Build 18363)
  • Windows 10 2004 (Build 19041)
  • Windows 10 20H2 (Build 19042)
  • Windows 10 21H1 (Build 19043)
  • Windows 11 21H2 (Build 22000)
  • Other (specify)

Other Windows Build number

No response

App minimum and target SDK version

  • Windows 10, version 1809 (Build 17763)
  • Windows 10, version 1903 (Build 18362)
  • Windows 10, version 1909 (Build 18363)
  • Windows 10, version 2004 (Build 19041)
  • Other (specify)

Other SDK version

No response

Visual Studio Version

2022

Visual Studio Build Number

No response

Device form factor

Desktop

Nuget packages

No response

Additional context

No response

Help us help you

Yes, but only if others can assist.

@chiragpandya04 chiragpandya04 added the bug 🐛 An unexpected issue that highlights incorrect behavior label Jan 17, 2024
@ghost ghost added the needs triage 🔍 label Jan 17, 2024
@ghost
Copy link

ghost commented Jan 17, 2024

Hello chiragpandya04, 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 🙌

@Arlodotexe Arlodotexe added the DataGrid 🔠 Issues on DataGrid control label Jan 23, 2024
@ghost ghost added the needs attention 👋 label Feb 7, 2024
@ghost
Copy link

ghost commented Feb 7, 2024

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.

2 similar comments
@ghost
Copy link

ghost commented Feb 22, 2024

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
Copy link

ghost commented Mar 9, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior DataGrid 🔠 Issues on DataGrid control needs attention 👋 needs triage 🔍
Projects
None yet
Development

No branches or pull requests

2 participants