Expand collapse issue in IOS ListView Item

4 posts, 0 answers
  1. Arun Kumar
    Arun Kumar avatar
    4 posts
    Member since:
    Dec 2015

    Posted 10 Feb Link to this post

    Hi,
    I am using telerik listview in our project, where we have a scenario the user can expand and collapse the content of the listview item and we use visibility to play with expand and collapse. when we collapse the listview item the height of that item is not getting reduced. the user can see the empty space when the item is collapsed.
    Is there any way we can force the UI to get redraw, so that the empty space can be avoided or any other way can we solve this issue.
  2. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 15 Feb Link to this post

    Hello,

    We cannot be sure for your setup. Could you please provide us with the customized DataTemplate you are using? It will help us to better understand exactly what you have in mind when you say "collapse" regarding a ListViewItem.

    Regards,
    Pavel R. Pavlov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft banner
  4. Arun Kumar
    Arun Kumar avatar
    4 posts
    Member since:
    Dec 2015

    Posted 15 Feb Link to this post

    Hi Pavel,

    PFB the DataTemplate, In this Template we have created 2 Rows in a grid where when the user clicks on the Grid in first row the second row Grid's visibility gets collapsed. once agian the user click the Grid in first row the second row Grid's visibility gets visible.

    This is how we achieve expand and collapse. but in IOS this is not working as expected.

    please provide a solution or workaround to fix this.

     <DataTemplate>

              <listView:ListViewTemplateCell>
                <listView:ListViewTemplateCell.View>
                <Grid>
                  <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                  </Grid.RowDefinitions>
                  <Grid>
                    <Grid.GestureRecognizers>
                      <TapGestureRecognizer
                          Command="{Binding ClickCommand}" CommandParameter="{Binding}"
                          NumberOfTapsRequired="1" />
                    </Grid.GestureRecognizers>
                    <Label HorizontalOptions="Center" VerticalOptions="Center" Text="List Item" TextColor="White" ></Label>
                  </Grid>
                  <Grid Grid.Row="1" HeightRequest="150" BackgroundColor="Green" IsVisible="{Binding IsVisible}" >
                    <BoxView Color="Green" HeightRequest="150" />
                  </Grid>
                </Grid>
                </listView:ListViewTemplateCell.View>
              </listView:ListViewTemplateCell>
            </DataTemplate>

     

    Thanks,

    Arun

  5. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 17 Feb Link to this post

    Hi arun,

    Thank you for providing us with your code. It helped us understand your case. It is true that the RadListView in iOS does not update its items automatically. This is why we logged this issue in our backlog system. 

    The workaround would be to manually trigger a layout cycle. This can be done by invalidating it using the adapter or by reloading your data.

    Regards,
    Pavel R. Pavlov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
DevCraft banner