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
close icon

Cell Error

My cell has an double cell type How to avoid the message when the cell is not a numeric value, and put its own thanks

3 Replies

AD Administrator Syncfusion Team June 18, 2003 07:25 AM UTC

You can do this in a CurrentCellValidating event handler.
Private Sub GridDataBoundGrid1_CurrentCellValidating(ByVal sender As Object, ByVal e As  CancelEventArgs) Handles GridDataBoundGrid1.CurrentCellValidating
	Dim cc As GridCurrentCell = Me.GridDataBoundGrid1.CurrentCell
    	Dim s As String = cc.Renderer.ControlText
	Try
		Dim d As Double = double.Parse(s)
	Catch
		'bad value
		e.Cancel = True
		cc.ErrorMessage = "MyMessage"
	EndTry
End Sub


AN Alexandre Nicholas June 18, 2003 07:51 AM UTC

> You can do this in a CurrentCellValidating event handler. why does the CurrentCellValidating event is raised 3 times when i lose focus from the grid control ? thanks


AN Alexandre Nicholas June 18, 2003 07:58 AM UTC

> > You can do this in a CurrentCellValidating event handler. > > why does the CurrentCellValidating event is raised 3 times when i lose focus from the grid control ? > > thanks i just resolved the problem seting the gridcontrol focus before i lease the CurrentCellValidating event thanks

Loader.
Live Chat Icon For mobile
Up arrow icon