Hi Emmanuel,
Thank you for using syncfusion product.
We checked the reported query “I have a large empty space that is created when I add a list to SfAccordion” from our end. You can achieve your requirement by setting the customized height(Based on the content) to HeightRequest of the parent (grid) element in Accordion content.
Code snippet XAML: Binding CutsomHeight property to HeightRequest of the parent element.
|
<syncfusion:AccordionItem.Content>
<Grid HeightRequest="{Binding CustomHeight}">
. . . . .
</Grid>
</syncfusion:AccordionItem.Content> |
Code snippet C# : CustomHeight calculation. View Model Class
|
public class ItemInfoRepository
{
public ObservableCollection<ItemInfo> Info { get; set; }
public ItemInfoRepository()
{
Info = new ObservableCollection<ItemInfo>
{
new ItemInfo() { Name = "Veggie burger", Description = "Veggie burger, garden burger, or tofu burger uses a meat analogue, a meat substitute such as tofu, textured vegetable protein, seitan (wheat gluten), Quorn, beans, grains or an assortment of vegetables, which are ground up and formed into patties.", ListViewHeight = 100 },
new ItemInfo() { Name = "Barbecue burger", Description = "", ListViewHeight = 0 },
new ItemInfo() { Name = "Chili burger", Description = "Consists of a hamburger, with the patty topped with chili con carne.", ListViewHeight = 100 }
};
} |
Model Class
|
public class ItemInfo : INotifyPropertyChanged
{
private double listViewHeight;
public double ListViewHeight
{
get { return listViewHeight; }
set
{
listViewHeight = value;
OnPropertyChanged("ListViewHeight");
}
} |
please let us know if you would require further assistance.
Regards,
SaiGanesh Sakthivel