We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Custom Validation and Custom function in Aspose.Grid.Web

Is there any way to put custom validation like Aspose.grid.Desktop wih Aspose.Grid.Web?
If no, do you plan on packing this feature?

Also, is it possible to add custom function, like it can be done in Aspose.Cells with the ICustom interface?

thanks for any light

Hi,

Thanks for considering Aspose.

Well, yes, you may do it with creating ValidationType.CustomFunction and make a javascript client side function to execute to implement the validation.

Example:

In the html mode you may create a client side javascript function
e.g.,



And in the .cs file, you may create the validation
e.g.,
// Custom function
.
.
.
cell = cells["C13"];
cell.CreateValidation(ValidationType.CustomFunction, true);
cell.Validation.ClientValidationFunction = "myvalidation1";

For reference, please check the source code of Protection/Validation demo (DataValidation.aspx) in Common Demos category from the Aspose.Grid.Web featured demos: http://www.aspose.com/Products/Aspose.Grid/Demos/.

Also, is it possible to add custom function, like it can be done in Aspose.Cells with the ICustom interface?

Well, currently it is not available, we will support it in our future versions to extend the formula calculation engine.

Thank you.


If the cell is null, what will be the value of ‘value’ in the function myvalidation1? Somehow in my application, if I try this one, all the cells which are null shows error.

Hi,

Well, if the cell is null, it will just higlight the cell with red crosses. What are the errors you got?, make sure that you have placed the codes correctly. For further reference, please check the datavalidation demo in our featured demos.

Thank you.