RadComboBox with ItemTemplate and FooterTemplate UI issue

1 Answer 173 Views
ComboBox
Scott
Top achievements
Rank 1
Scott asked on 18 Aug 2022, 02:04 AM

Hi, I ran into an issue the other day with the RadComboBox.

I have a RadComboBox with an ItemTemplate and a FooterTemplate. The FooterTemplate has a button inside it and the Item Template has some Labels and Images data bound to the ViewModel. When I run my app and I tap on the drop down in the RadComboBox, the footer pushes the items up and also overlays some of the items. Below is an image of my issue. I'm currently running 1.0.1 and have updated to 2.30 and experienced the same issue.

Didi
Telerik team
commented on 18 Aug 2022, 11:38 AM

Hi Scot,

I have tested the scenario when adding a FooterTemplate to the ComboBox control and cannot reproduce the behavior. Please send me the xaml definition of the template and the page where the ComboBox control is defined. I assume the issue is a layout issue and I need to research this case in details. 

Scott
Top achievements
Rank 1
commented on 18 Aug 2022, 06:52 PM

Sure, here's a test XAML page, Viewmodel, and Model that reproduces my issue

MainPage.xaml

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:telerik="http://schemas.telerik.com/2022/xaml/maui"
             x:Class="TestRadComboBox.MainPage">
    <ScrollView>
        <VerticalStackLayout
            Spacing="25"
            Padding="30,0"
            VerticalOptions="Center">
            <telerik:RadComboBox ItemsSource="{Binding Items}" 
                                 DisplayMemberPath="Name"
                                 IsEditable="True"
                                 SearchMode="Contains"
                                 SearchTextPath="Name"
                                 Placeholder="Select which city you want to visit"
                                 SelectionMode="Multiple"
                                 DropDownHeight="300"
                                 x:Name="comboBox">
                <telerik:RadComboBox.FooterTemplate>
                    <DataTemplate>
                        <StackLayout>
                            <Button Text="Add Items" 
                                    BackgroundColor="LightBlue"/>
                        </StackLayout>
                    </DataTemplate>
                </telerik:RadComboBox.FooterTemplate>
                <telerik:RadComboBox.ItemTemplate>
                    <DataTemplate>
                        <Label Text="{Binding Name}" TextColor="Black"/>
                    </DataTemplate>
                </telerik:RadComboBox.ItemTemplate>
            </telerik:RadComboBox>
        </VerticalStackLayout>
    </ScrollView>
</ContentPage>

MainPage.xaml.cs
namespace TestRadComboBox;

public partial class MainPage : ContentPage
{
	public MainPage()
	{
		InitializeComponent();
		BindingContext = new ViewModel();
	}
}

 

City.cs

namespace TestRadComboBox
{
    public class City
    {
        public string Name { get; set; }
        public int Population { get; set; }
    }
}

ViewModel.cs
using System.Collections.ObjectModel;

namespace TestRadComboBox
{
    public class ViewModel
    {
        public ViewModel()
        {
            this.Items = new ObservableCollection<City>
            {
                new City { Name = "Tokyo", Population = 13929286 },
                new City { Name = "New York", Population = 8623000 },
                new City { Name = "London", Population = 8908081 },
                new City { Name = "Madrid", Population = 3223334 },
                new City { Name = "Los Angeles", Population = 4000000},
                new City { Name = "Paris", Population = 2141000 },
                new City { Name = "Beijing", Population = 21540000 },
                new City { Name = "Singapore", Population = 5612000 },
                new City { Name = "New Delhi", Population = 18980000 },
                new City { Name = "Bangkok", Population = 8305218 },
                new City { Name = "Berlin", Population = 3748000 },
                new City { Name = "Tokyo", Population = 13929286 },
                new City { Name = "New York", Population = 8623000 },
                new City { Name = "London", Population = 8908081 },
                new City { Name = "Madrid", Population = 3223334 },
                new City { Name = "Los Angeles", Population = 4000000},
                new City { Name = "Paris", Population = 2141000 },
                new City { Name = "Beijing", Population = 21540000 },
                new City { Name = "Singapore", Population = 5612000 },
                new City { Name = "New Delhi", Population = 18980000 },
                new City { Name = "Bangkok", Population = 8305218 },
                new City { Name = "Berlin", Population = 3748000 },
                new City { Name = "Tokyo", Population = 13929286 },
                new City { Name = "New York", Population = 8623000 },
                new City { Name = "London", Population = 8908081 },
                new City { Name = "Madrid", Population = 3223334 },
                new City { Name = "Los Angeles", Population = 4000000},
                new City { Name = "Paris", Population = 2141000 },
                new City { Name = "Beijing", Population = 21540000 },
                new City { Name = "Singapore", Population = 5612000 },
                new City { Name = "New Delhi", Population = 18980000 },
                new City { Name = "Bangkok", Population = 8305218 },
                new City { Name = "Berlin", Population = 3748000 },
            };
        }

        public ObservableCollection<City> Items { get; set; }
    }
}

When I run a new Maui project with this code, I see that the first and last items, "Tokyo" and "Berlin" are completely cut off.  If I remove the itemTemplate, "Tokyo" and "Berlin are halfway cut off.

I'm running Telerik UI For Maui 1.0.1

1 Answer, 1 is accepted

Sort by
0
Didi
Telerik team
answered on 23 Aug 2022, 01:44 PM

Hi Scott,

I have reproduced the behavior. I have logged a bug report on your behalf. Follow the item at this link: https://feedback.telerik.com/maui/1577163-combobox-fist-item-and-last-item-are-covered-by-the-header-and-footer-templates 

I couldn't find a solution for this issue. It seems a layout issue. Let me now if I can assist with anything else. 

Regards,
Didi
Progress Telerik

The Premier Dev Conference is back! 

Coming to you live from Progress360 in-person or on your own time, DevReach for all. Register Today.


Tags
ComboBox
Asked by
Scott
Top achievements
Rank 1
Answers by
Didi
Telerik team
Share this question
or