Unplanned
Last Updated: 23 Sep 2022 16:43 by Robin
Robin
Created on: 23 Sep 2022 16:43
Category: ListView
Type: Bug Report
0
ListView: [UWP] The swipe area blocks the button in the cell when swipe offset is the same as content width

When adding swipe content, it block the button to be clicked when the items in the cell matches the swipe offset value, 

a. reduce the swipe offset.
b. place the minus button further to the left, so the button width to match the ListView swipe offset

Sample setup:

<telerikDataControls:RadListView x:Name="listView"
                                    IsItemSwipeEnabled="True"
                                    SwipeOffset="90, 0, 0, 0"
                                    SwipeThreshold="20"
                                    ItemsSource="{Binding Source}"
                                    SelectionMode="None">
    <telerikDataControls:RadListView.ItemTemplate>
        <DataTemplate>
            <listView:ListViewTemplateCell>
                <listView:ListViewTemplateCell.View>
                    <Grid ColumnDefinitions="*,90">
                        <!--  >> changed second row to 90 pixels, which is swipe offset  -->
                        <Label
                            FontAttributes="Bold"
                            FontSize="16"
                            Text="{Binding Sender}"
                            TextColor="Black" />
                        <StackLayout Grid.Column="1" 
                                        Orientation="Horizontal">
                            <Button
                                Clicked="Button_Clicked_1"
                                Text="+++"
                                TextColor="Gray" />
                            <Button
                                Clicked="Button_Clicked"
                                Text="---" />
                        </StackLayout>

                    </Grid>
                </listView:ListViewTemplateCell.View>
            </listView:ListViewTemplateCell>
        </DataTemplate>
    </telerikDataControls:RadListView.ItemTemplate>
    <telerikDataControls:RadListView.ItemSwipeContentTemplate>
            <DataTemplate>
                <Grid
                            Margin="0"
                            Padding="0"
                            ColumnSpacing="0"
                            RowSpacing="0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="90" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                    <telerikInput:RadButton
                                Grid.Column="0"
                                Margin="0"
                                BackgroundColor="Red"
                        Clicked="RadButton_Clicked"
                                FontFamily="FontAwesomeSolid"
                                FontSize="Medium"
                                Text="&#xf1f8;"
                                WidthRequest="90" />
                </Grid>
        </DataTemplate>
    </telerikDataControls:RadListView.ItemSwipeContentTemplate>
</telerikDataControls:RadListView>

0 comments