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

CellValueType in FormulaCell

Thread ID:

Created:

Updated:

Platform:

Replies:

21718 Nov 17,2004 07:35 PM Nov 18,2004 02:43 AM Windows Forms 1
loading
Tags: GridControl
Diana Galindo
Asked On November 17, 2004 07:35 PM

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

Administrator [Syncfusion]
Replied On November 18, 2004 02:43 AM

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.

CONFIRMATION

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.

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.

;