Nothing rendering for ListView

3 posts, 0 answers
  1. Andy Macourek
    Andy  Macourek avatar
    33 posts
    Member since:
    Mar 2010

    Posted 23 May 2018 Link to this post

    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. Andy Macourek
    Andy  Macourek avatar
    33 posts
    Member since:
    Mar 2010

    Posted 24 May 2018 in reply to Andy Macourek Link to this post

    I found the problem.  It was due to the control being in a StackLayout.  I moved to grid and all is fine.
  3. Yana
    Admin
    Yana avatar
    5013 posts

    Posted 25 May 2018 Link to this post

    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
Back to Top