LongListSelector Windows Phone 8.1

I wanted to Develop a similar layout like Lonlist Selector Wp8 in Windows phone 8.1.

I came across a issue, My list is not appearing.

XAML page

        <CollectionViewSource x:Name="MainGrps"

    <ListView ItemsSource="{Binding Source={StaticResource MainGrps}}"  Margin="50">

            <DataTemplate >
                <Grid Background="Gray">
                        <TextBlock Foreground="White" FontSize="20" Text="{Binding ItmName}"/>
                        <TextBlock Foreground="White" FontSize="20" Text="{Binding ItmType}"/>

            <GroupStyle HidesIfEmpty="True" >
                    <DataTemplate >
                        <Grid Background="Red">
                            <StackPanel Orientation="Horizontal" >
                                <TextBlock Text="{Binding GrpItmName}" Foreground="White"/>
                                <TextBlock Text="{Binding ItemsCount}" Foreground="White"/>

Code Behind

private void OnPageLoaded(object sender, RoutedEventArgs e)
lst_grp = new List();

        for (int i = 0; i < 10; i++)
            Grp grp = new Grp();
            grp.GrpItmName = "grp name " + i;
            grp.ItemsCount = i;

            grp.LstItms = new List<Itm>();

            Itm itm = new Itm();
            itm.ItmName = "itm name " + i;
            itm.ItmType = "itm type " + i;



        this.MainGrps.Source = lst_grp;

Any problem with above code?

Please help me to figure it out or suggest if u have working one

Source: windows

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.