Declined
Last Updated: 25 Apr 2023 08:13 by ADMIN
Legrand
Created on: 24 Apr 2023 12:28
Category: ListView
Type: Feature Request
0
horizontal listview

I tried to make an horizontal listview, using ListViewGridLayout. I want only one row with all the items from the collection.

I don't know how to set the SpanCount properly.

In the template, the image is not displayed (the function ImageResource  is working in other control), only the Label is displayed.

                <telerik:RadListView 
                    Grid.Column="3"                
                    ItemsSource="{Binding StepList}"
                    >
                    <telerik:RadListView.ItemTemplate>
                        <DataTemplate>
                            <telerik:ListViewTemplateCell>
                                <telerik:ListViewTemplateCell.View>
                                        <Grid>
                                            <HorizontalStackLayout Margin="10, 10, 10, 0">
                                                <Image IsVisible="True"  Source="{versares:ImageResource Images.nextstep.jpg}" HeightRequest="16" VerticalOptions="Center" />
                                                <Label Text="{Binding DisplayedName}" FontSize="16" FontAttributes="Bold" TextColor="Black" VerticalOptions="Center" />
                                            </HorizontalStackLayout>
                                        </Grid>
                                </telerik:ListViewTemplateCell.View>
                            </telerik:ListViewTemplateCell>
                        </DataTemplate>
                    </telerik:RadListView.ItemTemplate>
                    <telerik:RadListView.LayoutDefinition>
                        <telerik:ListViewGridLayout
                            SpanCount="{Binding StepListCount}"
                                HorizontalItemSpacing="2" 
                                VerticalItemSpacing="2" />
                    </telerik:RadListView.LayoutDefinition>
                </telerik:RadListView>
1 comment
ADMIN
Didi
Posted on: 25 Apr 2023 08:13

Hi Legrand,

The ListView LayoutDefinition has Orientation property, so you can choose whether the ListView layout will be horizontally or vertically oriented. https://docs.telerik.com/devtools/maui/controls/listview/layouts 

For GridLayout, this is the solution, just set Orientation property: 

<telerik:RadListView.LayoutDefinition>
    <telerik:ListViewGridLayout ItemLength="40" 
                                Orientation="Horizontal"
                                HorizontalItemSpacing="2" 
                                SpanCount="2"
                                VerticalItemSpacing="2" />
</telerik:RadListView.LayoutDefinition>

I have changed the status of this item to Declined, as the control provides this option. 

Regarding to the SpanCount, As you mentioned one row, I am not sure what is the exact value you want for SpanCount. Do you want to change it runtime? If yes, the property is Bindable property. The property must implement INotifyPropertyChanged interface. Please find attached a sample app showing how the SpanCount can be updated according to another value changed from a NumericInput control.

Regarding the image, please open a support ticket and send us more details on this case and the setup you have.

Regards,
Didi
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.