I have the followin 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:dataControls="http://schemas.telerik.com/2022/xaml/maui"
xmlns:mauiApp8="clr-namespace:MauiApp8"
x:Class="MauiApp8.MainPage"
BindingContext="{Binding Source={RelativeSource Self}}">
<Grid Margin="10"
ColumnDefinitions="Auto, Auto, *">
<dataControls:RadListView Grid.Column="0"
ItemsSource="{Binding FooItems}">
<dataControls:RadListView.ItemTemplate>
<DataTemplate x:DataType="{x:Type mauiApp8:Foo}">
<dataControls:ListViewTemplateCell>
<dataControls:ListViewTemplateCell.View>
<Grid ColumnDefinitions="Auto, Auto"
Padding="0, 4">
<Label Text="{Binding Name}"
TextColor="{Binding Name}" />
<Label Text="{Binding Description}"
Grid.Column="1" />
</Grid>
</dataControls:ListViewTemplateCell.View>
</dataControls:ListViewTemplateCell>
</DataTemplate>
</dataControls:RadListView.ItemTemplate>
</dataControls:RadListView>
<ListView Grid.Column="1"
ItemsSource="{Binding FooItems}">
<ListView.ItemTemplate>
<DataTemplate x:DataType="{x:Type mauiApp8:Foo}">
<ViewCell>
<Grid ColumnDefinitions="Auto, Auto"
Padding="0, 4">
<Label Text="{Binding Name}"
TextColor="{Binding Name}" />
<Label Text="{Binding Description}"
Grid.Column="1" />
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<Border Grid.Column="2"
Background="Green" />
</Grid>
</ContentPage>
Why doesn't the RadListView auto size the items correctly?
First column (red circle) is the RadListView which is cutoff.
Second column is the normal ListView which displays the text fully.
Code behind if needed is this:
public partial class MainPage : ContentPage
{
public List<Foo> FooItems { get; set; }
public MainPage()
{
FooItems =
[
new Foo("Hello", "Hello World this is a long text"),
new Foo("Hello", "Hello World this is a very very very long text")
];
InitializeComponent();
}
}
public class Foo
{
public string Name { get; set; }
public string Description { get; set; }
public Foo(string name, string description)
{
Name = name;
Description = description;
}
}