We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Auto height doesn't working when I using sfChips in items

Thread ID:

Created:

Updated:

Platform:

Replies:

142451 Feb 5,2019 07:02 AM UTC Feb 6,2019 12:15 PM UTC Xamarin.Forms 3
loading
Tags: SfListView
Cepega
Asked On February 5, 2019 07:02 AM UTC

Hello.
I have sfListView where I add shChipsGroup in items.
My XAML:
 <xForms:SfListView ItemsSource="{Binding Items}" AutoFitMode="Height">
                <xForms:SfListView.ItemTemplate>
                    <DataTemplate>
                        <Grid RowSpacing="0">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="1" />
                            </Grid.RowDefinitions>
                            <Grid RowSpacing="0" Padding="8,0,8,10">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="10" />
                                </Grid.ColumnDefinitions>
                                <StackLayout Orientation="Vertical" VerticalOptions="StartGrid.Row="0Grid.Column="0">
                                    <Label 
Grid.Row="1Text="{Binding Name}"/>
                                    <Label Grid.Row="1Text="{Binding CategoryName}" />
                                    <Label Grid.Row="1Text="{Binding TypeName}"/> 
                                    <Label Grid.Row="1Text="{Binding Description}"/>
                                    <Label Grid.Row="1Text="{Binding Price}"/>
                                </StackLayout>
                                <StackLayout Orientation="VerticalVerticalOptions="Start  Grid.Row="1Grid.ColumnSpan="2"> 
                                    <buttons:SfChipGroup Grid.Row="1"
                                                     ItemsSource="{Binding Ingredients}"
                                                     ChipPadding="8,8,0,0"
                                                     Type="Action"
                                                     DisplayMemberPath="Name">
                                    <buttons:SfChipGroup.ChipLayout>
                                        <FlexLayout HorizontalOptions="Start"
                                                    VerticalOptions="Start"
                                                    FlexLayout.AlignSelf="Start"
                                                    Direction="Row"
                                                    Wrap="Wrap"
                                                    JustifyContent="Start"
                                                    AlignContent="Start"
                                                    AlignItems="Start">
                                            </FlexLayout>
                                    </buttons:SfChipGroup.ChipLayout>
                                </buttons:SfChipGroup>
                                </StackLayout>
                            </Grid>
                            <BoxView Grid.Row="2"
                                     HeightRequest="1"
                                     Opacity="0.75"
                                     BackgroundColor="#CECECE" />
                        </Grid>
                    </DataTemplate>
                </xForms:SfListView.ItemTemplate>
            </xForms:SfListView>


When in FlexLayout I set Wrap="Wrap" my each row height has calculated is not correct. 
Screen:

But when I change Wrap to "NoWrap" - the height is correct:

Can you help me?



Cepega
Replied On February 5, 2019 11:57 AM UTC

The same problem in iOS and Android devices.
I tried add 
Loaded="listView_Loaded" to ListView where I called listView.RefreshListViewItem(), but it doesn't help me.

Gnana Priya Namasivayam [Syncfusion]
Replied On February 5, 2019 04:32 PM UTC

Hi Sergey, 
 
Thanks for using Syncfusion product. 
 
We have checked reported the query from our side and could able to reproduce the issue. We are currently validating the reported query and will update further details on February 5, 2019. We will appreciate your patience until then. 
 
Regards, 
Gnana Priya N 


Gnana Priya Namasivayam [Syncfusion]
Replied On February 6, 2019 12:15 PM UTC

Hi Sergey, 
 
We have checked the reported query from our side. We would like to know that default ItemHeight value of SfChip is double.NAN. So, we need to use ItemHeight for the SfChipGroup. So that, it get adjusted correctly to the view inside the ListView ItemTemplate. We have attached the modified sample for your reference, please find the sample from following. 
 
 
 
<StackLayout> 
   <buttons:SfChipGroup Grid.Row="1" ItemHeight="40" ItemsSource="{Binding Employees}" 
                        ChipPadding="8,8,0,0" 
                        Type="Action" 
                        DisplayMemberPath="Name"> 
       </buttons:SfChipGroup> 
</StackLayout> 
 
 
 
Regards, 
Gnana Priya N 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;