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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Format GroupDescriptor PropertyName

Thread ID:

Created:

Updated:

Platform:

Replies:

141143 Nov 27,2018 03:47 AM UTC Nov 27,2018 09:35 AM UTC Xamarin.Forms 3
loading
Tags: SfListView
Thijs van Rijswijk
Asked On November 27, 2018 03:47 AM UTC

Hi,

In my .xaml i have de following code:

                        <syncfusion:SfListView.DataSource>
                            <data:DataSource>
                                <data:DataSource.SortDescriptors>
                                    <data:SortDescriptor PropertyName="ClockDate" Direction="Ascending"/>
                                </data:DataSource.SortDescriptors>
                                <data:DataSource.GroupDescriptors>
                                    <data:GroupDescriptor PropertyName="ClockDate"/>
                                </data:DataSource.GroupDescriptors>
                            </data:DataSource>

ClockDate is a DateTime property.

Is it possible to format it like dd-MM-yyyy

Best regards,

Thijs van Rijswijk

Jayaleshwari N [Syncfusion]
Replied On November 27, 2018 06:27 AM UTC

Hi Thijs van Rijswijk, 
 
Thanks for Contacting Syncfusion Support. 
 
We have checked the reported query “Format GroupDescriptor PropertyName” from our side. You can achieve your requirement by using GroupHeadeTemplate and define the binding with StringFormat for the property you are bound to the elements loaded in the GroupHeaderTemplate. 
 
<syncfusion:SfListView.GroupHeaderTemplate> 
    <DataTemplate> 
        <ViewCell> 
            <ViewCell.View> 
                <Grid Padding="2" Margin="2"> 
                    <Frame Padding="2" Margin="2" OutlineColor="AntiqueWhite" HasShadow="True"> 
                        <StackLayout> 
                            <Label x:Name="label" Text="{Binding Key, StringFormat='\{0:dd-MM-yyyy}'}"  
                            FontSize="22"                                    
                            FontAttributes="Bold"                                     
                            VerticalOptions="Center"  
                            HorizontalOptions="Start"  
                            /> 
                        </StackLayout> 
                    </Frame> 
                </Grid> 
            </ViewCell.View> 
        </ViewCell> 
    </DataTemplate> 
</syncfusion:SfListView.GroupHeaderTemplate> 
 
We have attached the sample for your reference and you can download the same from the following location. 
 
Please let us know, if you would require further assistance. 
 
Regards, 
Jayaleshwari N. 


Thijs van Rijswijk
Replied On November 27, 2018 06:46 AM UTC

Hi,

Works like a charm.

Thank you.

Jayaleshwari N [Syncfusion]
Replied On November 27, 2018 09:35 AM UTC

Hi Thijs van Rijswijk, 

Thanks for the update. Please get in touch if you would require further assistance. 
 
Regards, 
Jayaleshwari N. 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon