Posted 25 March 2022, 12:48 pm EST
Hello
Is there a c1DateEdit method to close the calendar programmatically?
Thanks
Brian
Forums Home / ComponentOne / WinForms Edition
Posted by: softcomlimited on 25 March 2022, 12:48 pm EST
Posted 25 March 2022, 12:48 pm EST
Hello
Is there a c1DateEdit method to close the calendar programmatically?
Thanks
Brian
Posted 27 March 2022, 11:54 pm EST
Hi Brian,
You can use the CloseDropDown method of the C1DateEdit to close the calendar programmatically. If you are using .NET5/6 C1DateEdit, you can use the DroppedDown property of the C1DateEdit to close the calendar. Kindly refer to the documentation links below for more information.
Best Regards,
Kartik
Posted 28 March 2022, 8:49 am EST
Thanks for the reply Kartik,
I had tried that but it was not working and thought there was another way. I am trying to workaround what appears to be a bug with the focus of the drop-down calendar of
v4.0.20151.38 of c1.win.c1Input.c1DateEdit where you cannot use the mouse to click the [Ok] button of my dialog form unless you make the dialog form cover the calendar. When I upgrade to new c1 version I hope it gets fixed.
Private Sub c1PostDate_ValueChanged(sender As Object, e As EventArgs) Handles c1PostDate.ValueChanged
Dim DateReceived As Date = CDate(Me.c1cboBatchID.GetItemText(Me.c1cboBatchID.SelectedIndex, "DateReceived"))
If Me.c1PostDate.Value < DateReceived Then
Me.c1PostDate.Select()
Me.c1PostDate.CloseDropDown()
ShowMessageBox("Invalid Date", title, frmMessageBoxTypes.ErrorMsg, frmMessageBoxBtns.OK)
End If
End Sub
Regards
Brian
Posted 29 March 2022, 12:44 am EST
Hi Brian,
We could not see the issue with the C1DateEdit (4.0.20151.49) at our end. Kindly refer to the attached sample showing the behavior at our end. We suggest you try the latest version of the C1DateEdit and see if the issue persists. If so, could you please provide a stripped-down sample replicating the issue so that we can assist you in the best way possible?
Best Regards,
Kartik
Posted 29 March 2022, 12:55 pm EST
Kartik,
I am getting the problem when I use a form instead of the standard message box. the standard message box does not have the problem. Sample attached. If you move the msg form from covering the calendar the form gets “lost” and you can’t click [ok].
I have a feeling that this issue is related to a bug in the c1DateEdit where the form’s z-order gets changed when you click in the text area while the calendar is open. I think that fix requires an update to a more recent c1 version.
thanks
Brian
CloseDropDown_C1DE.zip
Posted 30 March 2022, 4:29 am EST
Hi Brian,
We could see the issue at our end. You will need to at least upgrade to version 4.0.20152.74 of C1 controls, in which we did not see this issue. Kindly refer to the attached sample showing the same. You can download this version from the link below.
Since, .NET4.0 controls are already in maintenance mode, meaning they will not receive any new features updates, bug fixes, we recommend you to upgrade to the latest version of C1 controls to receive regular features updates and bug fixes.
Kind Regards,
Kartik
Posted 30 March 2022, 4:30 am EST
Posted 30 March 2022, 9:27 pm EST
Thank you for the info.
Brian