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

Free Support Forum - aspose.com

Cell hints

Is there a way to set a cell hint from the client side? I am performing AJAX validation in the ClientValidationFunction and would like to set the hint to the text explaining why validation has failed. Basically my AJAX Validation call returns either an empty string (validation passed OK) or a specific validation failure text. I’d rather not do popup alerts, as my users use cut-and-paste extensively and could get multiple alert popups when multiple cells values are invalid.

/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}

<![endif]–>

Hi,


You can try the following code with the new Aspose.Cells.GridWeb v2.0.3.2003 version (attached).


function ClientValidationFunction(source, value)

{

if (value.length > 2)

{

source.data = "Length is more than 2.";

return false;

}

else

{

source.data = null;

return true;

}

}



Thank you.

Doesn’t work for me. I can change cell color with .style.backgroundColor, but the hint does not change. What’s interesting is that if I examine the cell.data in the debugger, it shows my error message. is it because I am in data bound mode? I am also having a problem with setCellValue not changing the cell grid values, but there the cell value does not change in the debugger either

Hi,

Could you show a sample project to reproduce the issue, we will check it soon.

Thank you.

Figured out that this was not working because I was trying to do a SetCellValue on a read only cell (the entire column is actually read only). But I was still able to set the value by assigning to the cell’s .InnerHTML property; it works until one sorts or posts back… It would be nice though if it were in fact possible to set the read only cells programatically, while not allowing user data entry, and still preserve the value in sort or postbacks. The use case for it is what I am trying to do: client validate function for data entry in CustomerId column cell does an AJAX call to retrieve a value for a CustomerName column. The customer name column is read only, it is a ‘lookup’ column, not something that the end user fills in. If data validation fails (i.e. no customer), id’d like to show a hint for the customer id cell showing why validation has failed: e.g. “Not a valid customer id”, or “Duplicate Customer Id”, etc.


Hi,



We appreciate if you kindly post a sample project to reproduce the issue, we need to check how you are changing the cell values. We will check it soon.



Thank you.