Listview in the SlideView Problem

4 posts, 0 answers
  1. Yakup
    Yakup avatar
    7 posts
    Member since:
    Dec 2019

    Posted 21 Mar 2020 Link to this post

    Hi

    Listview in the SlideView not working.

    Error;

    Value cannot be null. 
    Line 1

  2. Yakup
    Yakup avatar
    7 posts
    Member since:
    Dec 2019

    Posted 23 Mar 2020 in reply to Yakup Link to this post

    My Xaml SS
  3. Didi
    Admin
    Didi avatar
    359 posts

    Posted 23 Mar 2020 Link to this post

    Hello Yakup,

    Thank you for the provided file.

    I have created a sample based on it and I reproduced the error Value cannot be null. Usually this error occurs when something in the XAML is incorrect. I have researched the case further and here is what I have found: The content inside the slideview pages is created on-demand. So the SlideView control does not have all pages created. When you try to add 2 contentviews with ListView and bindings, the pages are still not created from the SlideView and the Value cannot be null is thrown.  

    Solution:  

    I suggest you add separate contentview files for both ListView controls and add them to the SlideView control, for example:

    <telerikPrimitives:RadSlideView x:Name="slideView">
        <telerikPrimitives:RadSlideView.ItemsSource>
            <x:Array Type="{x:Type ContentView}">
                <ContentView>
                    <local:View1/>
                </ContentView>
                <ContentView>
                    <local:View2/>
                </ContentView>
            </x:Array>
        </telerikPrimitives:RadSlideView.ItemsSource>
    </telerikPrimitives:RadSlideView>

    and the View1.xaml file:

    
      <ContentView.Content>
            <ListView ItemsSource="{Binding Items}" x:Name="listView" Margin="30, 0">
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <ViewCell>
                            <Grid>
                                <Label Text="{Binding Title}" FontSize="13" FontAttributes="Italic" TextColor="Gray" Grid.Column="1"/>
                            </Grid>
                        </ViewCell>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>
        </ContentView.Content>

    I hope this will help.

    Regards,
    Didi
    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
  4. Yakup
    Yakup avatar
    7 posts
    Member since:
    Dec 2019

    Posted 25 Mar 2020 in reply to Didi Link to this post

    Hi Didi, 

    Thank you for your answer.

Back to Top