This is a migrated thread and some comments may be shown as answers.

Format date grouping

1 Answer 149 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Marlos
Top achievements
Rank 1
Marlos asked on 04 Oct 2010, 04:04 PM
Good morning,

I wonder how he could format the date of the grouping
and if there is any setting so that the field does not appear in clustered
GridView.

Attached is the picture.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 05 Oct 2010, 03:45 PM
Hi Marlos,

You can change the display format of your DateTime property by using DataFormatString property as demonstrated in this code snippet:

<telerik:RadGridView Grid.Row="0" 
                     Name="clubsGrid" 
                     ItemsSource="{Binding Clubs}"
                     AutoGenerateColumns="False"
                     RowDetailsTemplate="{StaticResource RowDetailsTemplate}"
                     Margin="5">
    <telerik:RadGridView.Columns>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Established}"
                                    Header="Est." 
                                    DataFormatString="{}{0:d/M/yyyy}"/>
    </telerik:RadGridView.Columns>
    <telerik:RadGridView.GroupDescriptors>
        <telerik:GroupDescriptor Member="Established.Date"/>
    </telerik:RadGridView.GroupDescriptors>
</telerik:RadGridView>

Also, if you would like to ignore the time portion of DateTime when grouping you can group by the Date sub property of DateTime which is also demonstrated in the code snippet.

Hope this helps.

All the best,
Milan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Marlos
Top achievements
Rank 1
Answers by
Milan
Telerik team
Share this question
or