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

GridDateTimeColumn selection mode and customization

Thread ID:

Created:

Updated:

Platform:

Replies:

121485 Dec 19,2015 02:37 AM UTC Dec 22,2015 07:15 AM UTC WPF 3
loading
Tags: SfDataGrid
issam
Asked On December 19, 2015 02:37 AM UTC

Hi,
is it possible to make GridDateTimeColumn select only month/year like in this screen ?


i have tried setting the pattern to "YearMonth" but it had no effect .

- also it would be nice if there was a toggle button or a checkbox at the bottom of the popup to switch the selection mode between month and day .

- last thing it would be nice if we can style the GridDateTimeColumn, i don't know if it's possible .


thanks for your help .

Ayyanar Sasi Kumar Jeyaraj [Syncfusion]
Replied On December 21, 2015 07:13 AM UTC

Hi Issam,

Thank you for contacting Syncfusion support.

Query
Comments
GridDateTimeColumn select only month/year.

Your requirement can be achieved by setting GridDateTimeColumn.DisableDateSelection property and
GridDateTimeColumn.Pattern as YearMonth. Where editor allows you to select month instead of Date.
XAML:

<Syncfusion:GridDateTimeColumn HeaderText="Shipping"

                               MappingName="Shipping"
                               DisableDateSelection="True"
                               Pattern="YearMonth"/>

There was a toggle button or a checkbox at the bottom of the popup to switch the selection mode between month and day .
It is not possible to add button in editor to switch between month and date selection. You have to achieve your requirement by setting properties as mentioned for Query 1.
Style the GridDateTimeColumn.
You can style GridDateTimeColumn by setting GridDateTimeColumn.CellStyle property.

XAML:

<Window.Resources>

        <Style x:Key="Style" TargetType="Syncfusion:GridCell">

            <Setter Property="Background" Value="Aquamarine"/>

        </Style>

    </Window.Resources>


<Syncfusion:GridDateTimeColumn HeaderText="Shipping"  

                               MappingName="Shipping"
                               CellStyle="{StaticResource Style}">



Sample:
http://www.syncfusion.com/downloads/support/forum/121480/ze/WPF-1873611541

Please let us know if you have any further assistance.

Regards
Ayyanar

issam
Replied On December 21, 2015 11:38 AM UTC

cool  .

really appreciate .

Ayyanar Sasi Kumar Jeyaraj [Syncfusion]
Replied On December 22, 2015 07:15 AM UTC

Hi Issam,
Thanks for the Update.
Please let us know if you have any further assistance.
 
Regards
Ayyanar

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

;