This is a migrated thread and some comments may be shown as answers.
Nothing rendering for ListView
2 Answers 11 Views
This is a migrated thread and some comments may be shown as answers.
Andy Macourek
Top achievements
Rank 1
Andy Macourek asked on 24 May 2018, 04:46 AM

I am trying out the trial version and it is giving the expected message about purchasing the controls.  That is not the problem.  The problem is that nothing is rendering at all for Android. 

My code is very simple:

c#:

propertyList = new ObservableCollection<Property>() {
                new Property(){
                    ImageUrl = "camera.png",
                    Address = "Address1",
                    CombinedAddress = "City1, state1",
                    CombinedNumbers = "numbers1",
                    AtomId = 1
                },
                new Property(){
                    ImageUrl = "profile.png",
                    Address = "Address2",
                    CombinedAddress = "City2, state2",
                    CombinedNumbers = "numbers2",
                    AtomId = 2
                },
                new Property(){
                    ImageUrl = "redheart.png",
                    Address = "Address3",
                    CombinedAddress = "City3, state3",
                    CombinedNumbers = "numbers3",
                    AtomId = 3
                }
 
            };
 
            listView.ItemsSource = propertyList;

 

XAML:

<StackLayout x:Name="List" Orientation="Vertical" Spacing="20" Margin="30,0,30,0">
                <telerikDataControls:RadListView x:Name="listView"
                                     SwipeOffset="70, 0, 0, 0"
                                     SwipeThreshold="10">
                    <telerikDataControls:RadListView.ItemTemplate>
                        <DataTemplate>
                            <telerikListView:ListViewTemplateCell>
                                <telerikListView:ListViewTemplateCell.View>
                                    <StackLayout Orientation="Vertical">
                                        <Label Margin="10,10,10,0"
                                           FontAttributes="Bold"
                                           FontSize="16"
                                           Text="{Binding Address}"
                                           TextColor="Black" />
                                        <Label Grid.Row="1"
                                           Margin="10,0,10,10"
                                           FontAttributes="Italic"
                                           FontSize="13"
                                           Text="{Binding CombinedAddress}"
                                           TextColor="Gray" />
                                    </StackLayout>
                                </telerikListView:ListViewTemplateCell.View>
                            </telerikListView:ListViewTemplateCell>
                        </DataTemplate>
                    </telerikDataControls:RadListView.ItemTemplate>
                </telerikDataControls:RadListView>
 
            </StackLayout>

 

 

 

2 Answers, 1 is accepted

Sort by
0
Andy Macourek
Top achievements
Rank 1
answered on 24 May 2018, 02:28 PM
I found the problem.  It was due to the control being in a StackLayout.  I moved to grid and all is fine.
0
Yana
Telerik team
answered on 25 May 2018, 06:13 AM
Hi Andy,

I am glad to hear you've resolved the issue. Indeed. we'd recommend not placing RadListView inside a View that restricts the Height to the minimum amount of vertical space. Such Views are, for example, StackLayout or a Grid with <rowdefinition height="Auto">.

If you experience any additional issues with RadListView, write to us again.

Regards,
Yana
Progress 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
Asked by
Andy Macourek
Top achievements
Rank 1
Answers by
Andy Macourek
Top achievements
Rank 1
Yana
Telerik team
Share this question
or