The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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
ADAdministrator 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.