We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Binding group descriptions.

Thread ID:

Created:

Updated:

Platform:

Replies:

127626 Nov 29,2016 09:49 AM UTC Nov 29,2016 05:46 PM UTC Xamarin.Forms 1
loading
Tags: SfListView
Richard Bawden
Asked On November 29, 2016 09:49 AM UTC

I am trying setup the grouping of a list view in xaml rather than doing it via code behind - so I can bind to the property name.

I have tried adding the following but get the error that DataSource is not found in SfListView.Xforms.

<sync:SfListView.DataSource.GroupDescriptors>
     <syncds:GroupDescriptor PropertyName="Address.Town"/>
</sync:SfListView.DataSource.GroupDescriptors>

Ganesan V [Syncfusion]
Replied On November 29, 2016 05:46 PM UTC

Hi Richard,

 

Thanks for contacting Syncfusion Support. 

 

You can achieve your requirement like below code snippet,

 

 

  <sync:SfListView x:Name="listView"

                   IsStickyGroupHeader="True"

                   GroupHeaderSize="56"

                   ItemsSource="{Binding Customers}"

                   ItemSize="60">

    <sync:SfListView.GroupHeaderTemplate>

      <DataTemplate>

        <ViewCell>

          <ViewCell.View>

            <StackLayout BackgroundColor="Blue">

              <Label Text="{Binding Key}"/>

            </StackLayout>

          </ViewCell.View>

        </ViewCell>

      </DataTemplate>

    </sync:SfListView.GroupHeaderTemplate>

   

    <sync:SfListView.DataSource>

      <dataSource:DataSource>

        <dataSource:DataSource.GroupDescriptors>

          <dataSource:GroupDescriptor PropertyName="Address.Town"/>

        </dataSource:DataSource.GroupDescriptors>

      </dataSource:DataSource>

    </sync:SfListView.DataSource>

   

    <sync:SfListView.ItemTemplate>

      <DataTemplate>

        <Grid>

          <Label Text="{Binding Name}"/>

        </Grid>

      </DataTemplate>

    </sync:SfListView.ItemTemplate>

  </sync:SfListView>

 

 

We have prepared the sample based on your requirement and you can download the same from the below link,

 

http://www.syncfusion.com/downloads/support/forum/127626/ze/ListViewSample1107493825.zip

 

Please refer the UG documentation link below,

 

https://help.syncfusion.com/xamarin/sflistview/getting-started#grouping

 

Regards,

Ganesan V


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;