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. Image for the cookie policy date

GridDateTimeColumn selection mode and customization

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 .

3 Replies

AS Ayyanar Sasi Kumar Jeyaraj Syncfusion Team 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


IS issam December 21, 2015 11:38 AM UTC

cool  .

really appreciate .


AS Ayyanar Sasi Kumar Jeyaraj Syncfusion Team 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

Loader.
Up arrow icon