- Home
- Forum
- Xamarin.Forms
- SfListViewItems randomly disappearing/appearing
SfListViewItems randomly disappearing/appearing
Hello
I am using Syncfusion.Xamarin NuGet packages v17.3.0.33.
In my SfListView some items are randomly disappearing/appearing.
The layout of the SfListView is as follows:
Grouping
Grid
Col1 | Col2
Now the problem is that the texts in Col2 disappear sometimes. I couldn't figure out the exact circumstances when this happens, but often one of the following is the case.
- The list contains > 20 items
- Scrolling very fast causes items to disappear
- Scrolling slowly causes items to (re)appear.
- Col2 can contain normal or fomatted text, both disappear sometimes
- Only texts in Col2 disappear
This occurs for both iOS and UWP.
Do you have any idea why this happens and how to fix it?
Below you can see the xaml code.
<ContentView>
<ContentView.Content>
<Grid Margin="0, 10, 0, 10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<xForms:SfListView Grid.Row="1" ItemsSource="{Binding OverViewList}" AllowGroupExpandCollapse="False" IsStickyGroupHeader="False" SelectionMode="None" AutoFitMode="DynamicHeight" Margin="0, 10, 0, 10" TapCommand="{Binding OverViewItemTappedCommand}">
<xForms:SfListView.DataSource>
<dataSource:DataSource>
<dataSource:DataSource.GroupDescriptors>
<dataSource:GroupDescriptor PropertyName="Group"/>
</dataSource:DataSource.GroupDescriptors>
</dataSource:DataSource>
</xForms:SfListView.DataSource>
<xForms:SfListView.GroupHeaderTemplate>
<DataTemplate>
<ViewCell>
<Label Text="{Binding Key}" FontSize="Medium" FontAttributes="Bold" Margin="5, 10, 5, 0"></Label>
</ViewCell>
</DataTemplate>
</xForms:SfListView.GroupHeaderTemplate>
<xForms:SfListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid Margin="10, 0, 10, 0">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Label Grid.Column="0" Text="{Binding Key}" FormattedText="{Binding KeyFormatted}" LineBreakMode="WordWrap"/>
<Label Grid.Column="1" Text="{Binding Value}" FormattedText="{Binding ValueFormatted}" LineBreakMode="WordWrap"/>
</Grid>
</ViewCell>
</DataTemplate>
</xForms:SfListView.ItemTemplate>
</xForms:SfListView>
</ContentView.Content>
</ContentView>
Kind regards
Phil
SIGN IN To post a reply.
3 Replies
GP
Gnana Priya Namasivayam
Syncfusion Team
December 10, 2019 10:37 AM UTC
Hi Phil,
Thanks for using Syncfusion support.
We have used shared template in our sample and reported issue replicated in our side. We would like to inform you that it occurs because column width is not specified for the grid loaded inside ItemTemplate. You can define ColumnDefinition’s Width either as Auto or any to avoid the item rendering issue while scrolling. We have attached the tested sample below, please find them for your reference.
Sample: ScrollingIssue
|
<xForms:SfListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid Margin="10, 0, 10, 0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Label Grid.Column="0" Text="{Binding ContactName}" LineBreakMode="WordWrap"/>
<Label Grid.Column="1" Text="{Binding ContactNumber}" LineBreakMode="WordWrap"/>
</Grid>
</ViewCell>
</DataTemplate>
</xForms:SfListView.ItemTemplate>
|
Kindly check our sample and let us know whether reported issue resolved at your end also. If not , please revert us back with the issue replicated sample so that we could check and provide you possible solution at the earliest.
Regards,
Gnana Priya N
UN
Unknown
December 10, 2019 04:50 PM UTC
Thank you for your fast response.
I tried the things you recommended (Width="*" for the 2 columns), however the behavior was the same.
Sometimes Col2 disappeared.
Upon further inspecting your sample, I noted that I use both the "Text" and "FormattedText" properties.
I changed my code to only use "FormattedText" and now Col2 does not disappear anymore.
This worked for iOS as well as UWP.
Thank you for your help.
SP
Subburaj Pandian Veluchamy
Syncfusion Team
December 11, 2019 06:46 AM UTC
Hi Phil,
Thank you for the update. We are happy that the mentioned issue resolved at your end.
Please let us know, if you would require any further assistance.
Regards,
Subburaj Pandian V
Subburaj Pandian V
SIGN IN To post a reply.
- 3 Replies
- 3 Participants
-
UN Unknown
- Dec 9, 2019 09:06 AM UTC
- Dec 11, 2019 06:46 AM UTC