'How to show all columns in CollectionView

I have List with decent amount of columns (13 to be exact) When I populate my collection view I have problem because only 3-4 columns are visible, and I can't scroll collection view horizontally. I tried to improvise something using scroll view but it just made each row scrollable separatly like its not bound to header and other data in view, How to achive this kind of horizontall scroll?

C1 C2 C3 C4 ... C_N
**** **** ****
**** **** ****
**** **** ****

My CollectionVeiw code sample

                <CollectionView WidthRequest="1000" HorizontalOptions="FillAndExpand" Grid.Row="1" Grid.Column="0" VerticalScrollBarVisibility="Always"  HorizontalScrollBarVisibility="Always" BackgroundColor="White" ItemsSource="{Binding output}" SelectionMode="Single" SelectionChangedCommand="{Binding ItemSelectedCommand}" SelectedItem="{Binding SelectedItem}" EmptyView="No data">

                <CollectionView.Header>

                    <Grid BackgroundColor="#F5F9FF" Grid.Row="2" RowDefinitions="*" ColumnDefinitions="50,90,100,30,35,70,100,100,100,100,100,100,100" RowSpacing="10" ColumnSpacing="2">
                        <Label HorizontalTextAlignment="Center" VerticalTextAlignment="Center" BackgroundColor="White" Grid.Column="0" Text="C1"/>
                        <Label HorizontalTextAlignment="Center" VerticalTextAlignment="Center" BackgroundColor="White" Grid.Column="1" Text="C2"/>
                        <Label HorizontalTextAlignment="Center" VerticalTextAlignment="Center" BackgroundColor="White" Grid.Column="2" Text="C3 организације"/>
                        <Label HorizontalTextAlignment="Center" VerticalTextAlignment="Center" BackgroundColor="White" Grid.Column="3" Text="C4"/>
                        <Label HorizontalTextAlignment="Center" VerticalTextAlignment="Center" BackgroundColor="White" Grid.Column="4" Text="C5"/>
                        <Label HorizontalTextAlignment="Center" VerticalTextAlignment="Center" BackgroundColor="White" Grid.Column="5" Text="C6"/>
                        <Label HorizontalTextAlignment="Center" VerticalTextAlignment="Center" BackgroundColor="White" Grid.Column="6" Text="C7"/>
                        <Label HorizontalTextAlignment="Center" VerticalTextAlignment="Center" BackgroundColor="White" Grid.Column="7" Text="C8"/>
                        <Label HorizontalTextAlignment="Center" VerticalTextAlignment="Center" BackgroundColor="White" Grid.Column="8" Text="C9"/>
                        <Label HorizontalTextAlignment="Center" VerticalTextAlignment="Center" BackgroundColor="White" Grid.Column="9" Text="C10"/>
                        <Label HorizontalTextAlignment="Center" VerticalTextAlignment="Center" BackgroundColor="White" Grid.Column="10" Text="C11"/>
                        <Label HorizontalTextAlignment="Center" VerticalTextAlignment="Center" BackgroundColor="White" Grid.Column="11" Text="C12"/>
                        <Label HorizontalTextAlignment="Center" VerticalTextAlignment="Center" BackgroundColor="White" Grid.Column="12" Text="C13"/>
                    </Grid>

                </CollectionView.Header>

                <CollectionView.ItemTemplate  >
                    <DataTemplate x:DataType="model:AmanetProveraDocument_Select_Output" >
                        <Grid  RowDefinitions="40" ColumnDefinitions="50,100,100,100,100,100,100,100,100,100,100,100,100" RowSpacing="10" ColumnSpacing="2">
                            <Label HorizontalTextAlignment="Center" VerticalTextAlignment="Center" BackgroundColor="White" Grid.Column="0" Text="{Binding D1, Converter = {StaticResource NullToStringConverter}}"/>
                            <Label HorizontalTextAlignment="Center" VerticalTextAlignment="Center" BackgroundColor="White" Grid.Column="1" Text="{Binding D2, Converter = {StaticResource NullToStringConverter}}"/>
                            <Label HorizontalTextAlignment="Center" VerticalTextAlignment="Center" BackgroundColor="White" Grid.Column="2" Text="{Binding D3, Converter = {StaticResource NullToStringConverter}}"/>
                            <Label HorizontalTextAlignment="Center" VerticalTextAlignment="Center" BackgroundColor="White" Grid.Column="3" Text="{Binding D4, Converter = {StaticResource NullToStringConverter}}"/>
                            <Label HorizontalTextAlignment="Center" VerticalTextAlignment="Center" BackgroundColor="White" Grid.Column="4" Text="{Binding D5, Converter = {StaticResource NullToStringConverter}}"/>
                            <Label HorizontalTextAlignment="Center" VerticalTextAlignment="Center" BackgroundColor="White" Grid.Column="5" Text="{Binding D6, Converter = {StaticResource NullToStringConverter}}"/>
                            <Label HorizontalTextAlignment="Center" VerticalTextAlignment="Center" BackgroundColor="White" Grid.Column="6" Text="{Binding D7, Converter = {StaticResource NullToStringConverter}}"/>
                            <Label HorizontalTextAlignment="Center" VerticalTextAlignment="Center" BackgroundColor="White" Grid.Column="7" Text="{Binding D8, Converter = {StaticResource NullToStringConverter}}"/>
                            <Label HorizontalTextAlignment="Center" VerticalTextAlignment="Center" BackgroundColor="White" Grid.Column="8" Text="{Binding D9, Converter = {StaticResource NullToStringConverter}}"/>
                            <Label HorizontalTextAlignment="Center" VerticalTextAlignment="Center" BackgroundColor="White" Grid.Column="9" Text="{Binding D10, Converter = {StaticResource NullToStringConverter}}"/>
                            <Label HorizontalTextAlignment="Center" VerticalTextAlignment="Center" BackgroundColor="White" Grid.Column="10" Text="{Binding D11, Converter = {StaticResource NullToStringConverter}}"/>
                            <Label HorizontalTextAlignment="Center" VerticalTextAlignment="Center" BackgroundColor="White" Grid.Column="11" Text="{Binding D12, Converter = {StaticResource NullToStringConverter}}"/>
                            <Label HorizontalTextAlignment="Center" VerticalTextAlignment="Center"  Grid.Column="12" Text="{Binding D13, Converter = {StaticResource NullToStringConverter}}"/>
                        </Grid>
                        <!--</StackLayout>-->
                    </DataTemplate>
                </CollectionView.ItemTemplate>

            </CollectionView>


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source