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

TableView - TableSection - Cells disappear when custom cells are updated on WinUI #22424

Open
davidW83 opened this issue May 15, 2024 · 5 comments
Labels
area-controls-listview ListView and TableView migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert platform/windows 🪟 t/bug Something isn't working
Milestone

Comments

@davidW83
Copy link

davidW83 commented May 15, 2024

Description

The MAUI TableView control does some funny things. I've searched and found nothing regarding WinUI, only for Android without Shell.

I think it is basically the same issue from #16533 , thats why i stole the title. ;)

In my following tests this issue does not appear on Android! >edited

The cells dissappear and also mutliple cells that were added let the whole list collapse.

The issue is triggered by TableSection.Add / .Remove while using custom cells.

My question regarding this isuse are:

  • adding remiving cells are ised in combinatoin with options being available or not. Is there a working method for this ?
    OR
  • what is the recommended alternative besides a table section for a static list with custom cells?

Steps to Reproduce

  1. My project uses the following versions.
  • I'm not using Shell
  • i tried MAUI 8.0.7 first without success.
<UseMaui>true</UseMaui>
<MauiVersion>8.0.21</MauiVersion>
<SingleProject>true</SingleProject>

<TargetFrameworks>net8.0-android</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.22621.0</TargetFrameworks>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
  1. A simple page with a TableView. As you can see it already contains some cells.
<ContentPage.Content>
           <TableView  
                       Margin="3" 
                       Grid.Row="1" 
                       x:Name="tblMain" 
                       HasUnevenRows="True" 
                       HorizontalOptions="Fill" VerticalOptions="Fill" >
               <TableSection  Title="testSection" x:Name="tblSection1" >
                   <ViewCell>
                       <Label Text="Just a label "></Label>
                   </ViewCell>
                   <ViewCell>
                       <Grid ColumnDefinitions="*,Auto"> 
                           <Label Grid.Column="0" Text="Just another label" HorizontalOptions="Start"></Label>
                           <Switch Grid.Column="1" HorizontalOptions="End"></Switch>
                       </Grid>
                   </ViewCell>
               </TableSection>
           </TableView>
</ContentPage.Content>
  1. Execute the following from anywhere, e.g. a Tolbaritem.Click()
 private void addCell()
 {
     var vc = new ViewCell();
     var lbl = new Label { Text = "tblSection1.count:" + tblSection1.Count }; ;
     vc.View = lbl;
     tblSection1.Add(vc);
 }
  1. See what happens.
  • the previously cells dissappear, but the new cell is being rendered
  • after adding mutliple cells, the list randomly collapses

Link to public reproduction project repository

No response

Version with bug

8.0.7 SR2

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

Unknown/Other

Affected platforms

Windows, I was not able test on other platforms

Affected platform versions

Windos SDK 10.0.17763.0

Did you find any workaround?

The only workaround would not using a TableView, which would be a nightmare to refactor for Moving from Xamaroin to MAUI. :|

Relevant log output

No response

@davidW83 davidW83 added the t/bug Something isn't working label May 15, 2024
Copy link
Contributor

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@davidW83
Copy link
Author

tableview_error

Added an example gif

@PureWeen PureWeen added the area-controls-listview ListView and TableView label May 15, 2024
@mattleibow
Copy link
Member

This was supposedly fixed in 8.0.7: 7af421e

But, it seems to still be here and this is slightly different maybe with adding items instead of changing items.

@mattleibow mattleibow added this to the Backlog milestone May 15, 2024
@mattleibow mattleibow added the migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert label May 15, 2024
@davidW83
Copy link
Author

Ty, edited my comment regarding Android.
The issue seems to appear on WinUI, but i tested it only on Android & WinUI.

@davidW83
Copy link
Author

Hello,
i just wanted to ask if there will be any progress? :)
We have made heavy use of that control in xamarin since we have a mix of Android, UWP, IOs Apps that need to be converted.
To find a workarounds can cause heavy refactoring (since that control was good for any settingspage and we have alot of them).

Otherwise you should maybe add a warning or something to use this control on WInUI since it does not really sem to work well.
: /

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-listview ListView and TableView migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert platform/windows 🪟 t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants