Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
585
Ultracalendercombo
posted

Hello NG,

is it possible to create the following behaviour with the ultracalendercombo

The format for date is German (02.11.2009).

The user enters 0211 --> on lost focus the Value should be 02.11.2009

Th user enters 02 --> on lost focus the Value should be 02.11.2009

I have a certain month Value stored in a variable (e.g. 2 for february). The user enters 02 in the ultracalendercombo --> on lost focus the control should have the value 02.02.2009.

Thanks in advance for your help!

Stefan

  • 69832
    Suggested Answer
    Offline posted

    If you set AllowNull to false, the ValidationError event will fire when the user tries to leave if the contents cannot be parsed into a DateTime. You might be able to handle the event and change the value when the e.ErrorValue returns a value like the ones you listed here.

    Another approach would be to use the IEditorDataFilter interface to intercept the values as they are passed between the editor and the control, and change them. The control's embeddable editor exposes a DataFilter property (of type IEditorDataFilter); you can get a reference to the control's editor like so:

    Infragistics.Win.UltraWinSchedule.CalendarCombo.CalendarComboEditorUIElement embeddableElement =
    this.ultraCalendarCombo1.UIElement.GetDescendant( typeof(Infragistics.Win.UltraWinSchedule.CalendarCombo.CalendarComboEditorUIElement) ) as
    Infragistics.Win.UltraWinSchedule.CalendarCombo.CalendarComboEditorUIElement;
    EmbeddableEditorBase editor = embeddableElement != null ? embeddableElement.Editor : null;