From: Pinar Can
Subject: YNT: Syncfusion support community forum 139619, SfListView, has been updated.
Hi, let me shared my codes:
XAML SIDE:
<Entry x:Name="entryTestControl" FontSize="Large" WidthRequest="80" Keyboard="Numeric TextChanged="EntryTestControlTextChanged"></Entry>
<ListView x:Name="SfListView" RowHeight="100" HeightRequest="500" ItemTapped="SfListView_ItemTapped">
<ListView.ItemTemplate>
<DataTemplate>
<Grid Margin="2" Padding="2">
<Frame Margin="1" Padding="1" CornerRadius="10" HasShadow="True" BackgroundColor="DeepSkyBlue">
<StackLayout Orientation="Horizontal" HorizontalOptions="FillAndExpand" Margin="5">
<StackLayout VerticalOptions="Center">
<Label x:Name="labelTest1" Text="{Binding Test1}" FontSize="Medium" ></Label>
</StackLayout>
<StackLayout VerticalOptions="Start" HorizontalOptions="EndAndExpand">
<StackLayout Orientation="Horizontal" HorizontalOptions="FillAndExpand">
<Label x:Name="labelTest2 " Text="Required" FontSize="Small"></Label>
<Label x:Name="labelTest3" Text="Picked" FontSize="Small" HorizontalOptions="EndAndExpand"></Label>
</StackLayout>
<StackLayout Orientation="Horizontal" HorizontalOptions="FillAndExpand">
<Label x:Name="labelTest4" Text="{Binding Test4}" FontSize="Large"
FontAttributes="Bold" TextColor="Black" HorizontalOptions="EndAndExpand"></Label>
<Label x:Name="labelTest5" Text="{Binding Test5}"FontSize="Large"
FontAttributes="Bold" TextColor="Black" HorizontalOptions="EndAndExpand"></Label>
</StackLayout>
</StackLayout>
</StackLayout>
</Frame>
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
And the CS SIDE:
private async void EntryTestControlTextChanged (object sender, TextChangedEventArgs e)
{
try
{
double value;
if (Double.TryParse(e.NewTextValue, out value))
{
if (e.OldTextValue != e.NewTextValue)
{
if (myList != null)
{
myList.Quantity = value;
SfListView.ItemsSource = null;
SfListView.ItemsSource = myList;
CalculateTotalCount();
if (total > 100)
{
await DisplayAlert("Warning", "Total exception!", "Ok");
myList.Quantity = selected.Quantity;
SfListView.ItemsSource = null;
SfListView.ItemsSource = myList;
CalculateTotalCount();
entryTestControl.Text = selected.Quantity.ToString();
}
}
}
}
else
{
if (myList != null)
{
myList.Quantity = 0;
SfListView.ItemsSource = null;
SfListView.ItemsSource = myList;
CalculateTotalCount();
}
}
}
catch { }
}
private void CalculateTotalCount()
{
try
{
total = 0;
for (int i = 0; i < myList.Count; i++)
total += myList[i]. Quantity;
labeltotal.Text = total.ToString() + " unit";
}
catch { }
}
So, here is my question: When I use the normal ListView, I can see all of the result of my codes. But when I use the SfListView, there is only space.
I checked and I know my changes are came but just doesn’t show. Why? Is this about SfListView structure or what? Bcs there no error,datas came BUT doesn’t show my page.
Thanks, regards.
Pınar CAN