Event on the DateTimeEditbox

Editors for WPF Forum

Posted 8 years ago by Doraiswamy
Version: 11.1.0542
Avatar
Hi,

Is there any separate event for Doubleclick on the Dropdown calendar in the DateTimeEditBox since i could able to find only DoubleClick for the wholeControl. The control closes the Dropdown immediately if the format is "d" but if the format is "g" then this does not happen since the control waits for other possible inputs. Is there any way to achieve the same result as in format "d". Kindly advise.

Comments (3)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hello,

You would have to customize the DropDownContent/DropDownContentTemplate to achieve that. The default DropDownContent for the "d" format is shown below in an implicit Style. You'd probably want to remove the CloseOnSingleSelection behavior. You can also add additional attached behaviors for double clicking as needed.
<!-- editors:DateTimeEditBox -->
<Style x:Key="{x:Type editors:DateTimeEditBox}" TargetType="{x:Type editors:DateTimeEditBox}">
        <Trigger Property="DefaultDropDownContentType" Value="MonthCalendar">
            <Setter Property="DropDownContentTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <editors:MonthCalendar BorderThickness="0" ViewResetMode="FirstSelected"
                                SelectedDate="{Binding DateValue, RelativeSource={RelativeSource AncestorType={x:Type editors:DateTimeEditBox}}}"
                                Style="{Binding MonthCalendarStyle, RelativeSource={RelativeSource AncestorType={x:Type editors:DateTimeEditBox}}}"
                                editors:MonthCalendarDropDownBehavior.CloseOnClearSelection="True"
                                editors:MonthCalendarDropDownBehavior.CloseOnEscapeKey="True"
                                editors:MonthCalendarDropDownBehavior.CloseOnSingleSelection="True">
                            <editors:MonthCalendar.MaxDate>
                                <MultiBinding Converter="{StaticResource CoalesceConverter}">
                                    <Binding Path="Maximum"
                                            RelativeSource="{RelativeSource AncestorType={x:Type editors:DateTimeEditBox}}" />
                                    <Binding Source="{x:Static editors:DateTimeHelper.DefaultMaxDateTime}" />
                                </MultiBinding>
                            </editors:MonthCalendar.MaxDate>
                            <editors:MonthCalendar.MinDate>
                                <MultiBinding Converter="{StaticResource CoalesceConverter}">
                                    <Binding Path="Minimum"
                                            RelativeSource="{RelativeSource AncestorType={x:Type editors:DateTimeEditBox}}" />
                                    <Binding Source="{x:Static editors:DateTimeHelper.DefaultMinDateTime}" />
                                </MultiBinding>
                            </editors:MonthCalendar.MinDate>
                        </editors:MonthCalendar>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Trigger>
    </Style.Triggers>
</Style>


Actipro Software Support

Posted 8 years ago by Doraiswamy
Avatar
Hi,

Much thanks. Can you please let me know where i can look for the DataTemplate if format is "g" or any reference to add attached events for editors:MonthCalendarDropDownBehavior
Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hello,

If you've purchased WPF Studio, then the complete Styles are available to download from your account (under Organization Purchases). If you purchased Editors for WPF individually or as part of WPF Essentials, then please send a request to our support address asking for the default Styles.


Actipro Software Support

The latest build of this product (v2018.1 build 0675) was released 14 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.