- Home
- Forum
- Xamarin.Forms
- Format GroupDescriptor PropertyName
Format GroupDescriptor PropertyName
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
SIGN IN To post a reply.
3 Replies
JN
Jayaleshwari N
Syncfusion Team
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.
Sample link: http://www.syncfusion.com/downloads/support/directtrac/general/ze/141143Format2069433710
Please let us know, if you would require further assistance.
Regards,
Jayaleshwari N.
TV
Thijs van Rijswijk
November 27, 2018 06:46 AM UTC
Hi,
Works like a charm.
Thank you.
JN
Jayaleshwari N
Syncfusion Team
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.
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
TV Thijs van Rijswijk
- Nov 27, 2018 03:47 AM UTC
- Nov 27, 2018 09:35 AM UTC