.NET Maui Editor in ListView Won’t Accept Input

I am upgrading an app from Xamarin to Maui. A form with a ListView that used to work perfectly, now will not accept input in Entry nor Editor controls, and Buttons do not work, UNLESS the item is the 1st or 2nd item in the list!!! (you can’t make this stuff up, folks!).

The form has a button to add another element to the collection. That collection that is bound to the list view. Each element has some data entry fields (2 Entry controls, 1 Editor control) and also a Button.

If the list is empty, I can add 1 item, then add another. Everything works fine. If I add a 3rd (or more), the controls in those list items do not accept input. (!)

My XAML looks like this (I’ve simplified it a bit for clarity):

<ContentPage.Content>

   <StackLayout Orientation="Vertical" VerticalOptions="StartAndExpand">

       <Button WidthRequest="200" HeightRequest="50" Text="Add New" HorizontalOptions="Center" Clicked="NewCommentClicked"/>
       
       <BoxView HeightRequest="10" />

       <StackLayout Orientation="Vertical" VerticalOptions="StartAndExpand" HeightRequest="1200">

       <ListView x:Name="CommentsList" 
                 ItemsSource="{Binding .Comments}"   
                 SelectionMode="None" 
                 SeparatorVisibility="None" 
                 RowHeight="220" 
                 VerticalOptions="StartAndExpand">

           <ListView.ItemTemplate>
               <DataTemplate>
                   <ViewCell>
                       <ViewCell.View>
                           <Grid>
                               <Grid.RowDefinitions>
                                   <RowDefinition Height="40"/>
                                   <RowDefinition Height="40"/>
                                   <RowDefinition Height="40"/>
                                   <RowDefinition Height="40"/>
                                   <RowDefinition Height="5"/>
                               </Grid.RowDefinitions>
                               <Grid.ColumnDefinitions>
                                   <ColumnDefinition Width="10"/>
                                   <ColumnDefinition Width="90"/>
                                   <ColumnDefinition Width="80"/>
                                   <ColumnDefinition Width="400"/>
                                   <ColumnDefinition Width="80"/>
                               </Grid.ColumnDefinitions>
                               <Label Grid.Row="0" Grid.Column="1" WidthRequest="80"  Text="Rel (in):" VerticalOptions="Start" />
                               <Entry Grid.Row="0" Grid.Column="2" WidthRequest="80"  Text="{Binding RelDepth}" VerticalOptions="Start" />
                               
                               <Label Grid.Row="1" Grid.Column="1" WidthRequest="80"  Text="Abs (ft):" />
                               <Label Grid.Row="1" Grid.Column="2" WidthRequest="80"  Text="{Binding AbsDepth}" />

                               <Editor Grid.Row="0" Grid.Column="3" Grid.RowSpan="4"
                                      WidthRequest="400" 
                                      HeightRequest="120"
                                      Text="{Binding Text}" 
                                      Placeholder="Comment(s)..."
                                      BackgroundColor="#EFEFEF"
                                      Style="{StaticResource BigBlackTextEntry}"
                                      HorizontalOptions="StartAndExpand"
                                      VerticalOptions="Start"/>

                               <Button Grid.Row="3" Grid.Column="1" WidthRequest="90" HeightRequest="50" Text="Remove" />

                               <BoxView Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="4" HeightRequest="1" BackgroundColor="Cyan" />
                           </Grid>
                       </ViewCell.View>
                   </ViewCell>
               </DataTemplate>
           </ListView.ItemTemplate>
       </ListView>

       </StackLayout>
       
   </StackLayout>

</ContentPage.Content>

In the code behind, I set the Binding context like this:


 /// in the class instance data...
 private CommentBinding ViewModel { get; set; } 

 /// elsewhere - in the constructor
 ViewModel = new CommentBinding() { Comments = theModels };

 BindingContext = ViewModel;

 /// when an item is added 

 private void NewCommentClicked(object sender, EventArgs e)
 {
   try
   {
     DepthModel newComment = new DepthModel() { RelDepth=0 };

     newComment.RecalcAbsDepth(_startingAbsDepthInches);

     ViewModel.Comments.Add(newComment);

     ViewModel.NotifyChange();
   }
   catch (Exception exception)
   {
     // log error... etc
   }
 }


The attached screen shot shows the 3 items in the list. The first two are editable and everyting works. The 3rd item does not allow any data entry (as if the controls were disabled – but we don’t do that) and the button “Remove” does not respond.

Please note that the StackView that wraps the ListView had to be added to get the ListView to position properly (that is yet another mystery) – and the 1200 HeightRequest is an experiment to see if this is influencing the odd behavior – I’m not concerned about these right now.

All ideas welcome, of course.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật