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

CellValueType in FormulaCell

Is there a way to prevent the user to enter values in a formula cell that will produce anything different than a double? I have tried setting the CellValueType to typeof(double) but this doesn''t work. Thanks DG

1 Reply

AD Administrator Syncfusion Team November 18, 2004 07:43 AM UTC

A formulacell must have the CellValueType string (which is teh default) since its ''real value'' has to be a formula string. I am not sure what you mean by ''Is there a way to prevent the user to enter values in a formula cell that will produce anything different than a double?'' If cell A2 has a value of ''=Sin(A1)'', exactly what do you want to prevent the user from typing into cell A2? In general, you can validate what a user types into a cell by handling the CurrentCellValidating event. In that event, if grid.CurrentCell.Renderer.ControlText holds something you do not want the user to leave in that cell, then you can set e.Cancel = true, and the grid will not allow the user to leave theh cell without correcting the problem.

Loader.
Live Chat Icon For mobile
Up arrow icon