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

Formatting Date Text in MonthCalendar

Thread ID:





24689 Feb 9,2005 02:42 PM UTC Feb 9,2005 05:05 PM UTC WinForms 1
Tags: GridControl
Chris Thompson
Asked On February 9, 2005 02:42 PM UTC

I have an issue formatting text entered in a MonthCalendar in a databound grid. I''m using the following code: Private Sub grdDetail_CurrentCellValidating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles grdDetail.CurrentCellValidating Dim cc As GridCurrentCell = Me.grdDetail.CurrentCell If cc.ColIndex = 3 Then If IsNumeric(cc.Renderer.ControlText) Then cc.Renderer.ControlText = String.Format("{0:##/##/####}", CType(cc.Renderer.ControlText, Integer)) End If End If End Sub This actually works great in formatting the text entered by a user. However, when a user enters a date in the field, tabs to the next field and the tabs back to the date field and clears the date out if the field the control throws a date format error. The only way to get out of the field is to enter a date or hit the escape key. If I have no code in the CurrentCellValidating event this does not happen. Any hint on how I can still format a date entered and not have this error happen when they clear the field? Thanks

Administrator [Syncfusion]
Replied On February 9, 2005 05:05 PM UTC

Hi Chris, I tried reproducing it and created a small sample but that seems to be fine. I am probably missing something. Can you upload a small sample project with steps how to provoke the behavior? If upload does not work send it to support@syncfusion.com Thanks, Stefan


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon