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

Free Support Forum - aspose.com

Cell Validation Problems

I am using GridWeb in an ASP.NET application, and I am encountering a number of problems related to cell validations:

1) I added a List validation on cell. I also added a custom comment on the cell. The tooltip for the cell now says:

My Cell Value

My custom tool tip

I want to remove the part, as these are useless to the user and often misleading. This is even more important when the validation is a regular expression, as the cell tooltip will display the regex used! How can this tooltip be modified with a custom message?

2) I set Date validation on a cell. This came up in yyyy/mm/dd format. I want to use dd/mm/yyyy format in ALL the worksheet. How can this be done? I tried setting the Custom property on the cell to "dd/mm/yyyy", and the cell then appeared correctly formatted. However, when I click on the cell to edit it, the cell value switches to "yyyy-mm-dd" format!

3) The arrow to display the date picker on the cells is appearing, but nothing happens when I click it. A javascript message is appearing: "Calendar.style is null or not an object"

4) When a cell fails validation, it comes up with red boxes. Can this behaviour be modified to shade the cell background instead?

Platform:

ASP.NET 2.0 with MS AJAX Extensions

GridWeb 2.0.3.1000

IE 7.0

Hi,

1). Yes, by default, when you set validations e.g Regular Expression, List etc., the tool tip is displayed based on the validation type set. We will check the feasibility if we can enhance this behavior, we will get back to you soon.

2). Yes, this is how it works.For your information, the <span style=“font-size: 9pt; font-family: “Arial”,“sans-serif”;”><span style=“font-family: “Times New Roman”; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;”>
<span style=“font-size: 9pt; font-family: “Arial”,“sans-serif”;”>Date validation supports yyyy/mm/dd format only at
the client side. So, we recommend you to use some custom validation function to validate your desired dd/mm/yyyy<span style=“font-size: 9pt; font-family: “Arial”,“sans-serif”;”> format instead of Date Validation.


3). Well, this behavior occurs when you use only custom date formatting using CustomFormat property in data binding mode and do not use Date Validation. We will check it but for your issue: “Calendar.style is null or not an object”, we don’t find it. Please try the attached version and let us know if you still find this issue. If you do, kindly create a simple project to show the issue, we will check it soon.

4). Yes, it can be changed.

Here is a solution to implement your need, you can follow it.


Please try the following steps:

i) Set the property OnCellErrorClientFunction=“onCellValidationError” in aspx.

ii) Add the onCellValidationError client script function like:

function onCellValidationError(o)

{

o.style.backgroundImage = “url(’/agw_client/dot.gif’)”;


}

iii) Customize the background image file to replace the foreground/background image url for your need.

iv) You must use backgroundImage instead of backgroundColor, because GridWeb cannot restore the backgroudColor if validation succeeds.



I have also attached the latest fix version with this post, kindly try it


Thank you.

Thanks for your answers

1) Yes, this is a high priority item for us

2) OK using custom format

3) Will not be using date picker

4) Worked fine

A problem i noted with validations is that i have a Grid with 2 rows, each having the same validation on the cells in column 1. The validation is "Number", with a custom format of "£0.00". The numbers appear correctly formatted as currency. However, when I highlight the first row, copy it and paste it in the second row, the number validation fails. It seems that copy-paste is pasting the display value modified by the custom format (eg "£123.00" as a string) instead of the actual cell value of 123 (an integer).

Hi,

"A problem i noted with validations is that i have a Grid with 2 rows,
each having the same validation on the cells in column 1. The
validation is “Number”, with a custom format of “£0.00”. The numbers
appear correctly formatted as currency. However, when I highlight the
first row, copy it and paste it in the second row, the number
validation fails. It seems that copy-paste is pasting the display
value modified by the custom format (eg “£123.00” as a string) instead
of the actual cell value of 123 (an integer)."

Do you apply the data validation and custom number formatting together on the column cells? We appreciate if you create a simple test code / project to show the issue, we will check it soon.

Thank you.

Attached is a simple application which demonstrates 2 issues:

1) Validator: Highlight the row that has data, right click, copy, and paste on the second row. Pasted data fails validator. Also, when accessed from code behind, the pasted cell's value is a string NOT a number as the copied cell.

2) Sorting: Clicking on Col3 sort column header gives an error. Could be I am doing something wrong?

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for considering Aspose.

We have found your mentioned issues after an initial test. We will look into them and get back to you soon. Your issue has been registered in our internal issue tracking system with issue id CELLSNET-14194.

Thank you & Best Regards,

Hi,<?xml:namespace prefix = u1 /><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for considering Aspose.

Guy007:
1) Validator: Highlight the row that has data, right click, copy, and paste on the second row. Pasted data fails validator. Also, when accessed from code behind, the pasted cell's value is a string NOT a number as the copied cell.

We have fixed the issue in the attached latest version of Aspose.Cells.GridWeb v<?xml:namespace prefix = st1 />2.0.3.2008.

Guy007:
2) Sorting: Clicking on Col3 sort column header gives an error. Could be I am doing something wrong?

For this issue, we recommend initializing the code when page is not posted back. i.e.

if (!IsPostBack)

{

GridWeb1.CellCommand += new CellEventHandler(GridWeb1_CellCommand);

……….

}

Thank You & Best Regards,

The issues you have found earlier (filed as 14194) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Hi,

Well, the GridWeb control provides a property named “<span style=“font-size: 10pt; font-family: “Courier New”;” lang=“EN-US”>DisplayCellTip” whose default value is
true. You can set it to false for your need. The comment you set will be only displayed in tool
tip.



Thank you.

Yes DisplayCellTip removes the validation tooltips, but when I add a comment as a tooltip I still get the “” prefix before my tooltip text! I want it to display my tooltip, and nothing else…

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Yes, we have found your issue after an initial test. We will look into it and get back to you soon.

Thank You & Best Regards,

Hi,

Please try the attached version/fix v2.1.1.2002.

We have removed the “” prefix of the tooltip
in Aspose.Cells.GridWeb v<st1:chsdate isrocdate=“False” islunardate=“False” day=“30” month=“12” year=“1899” w:st=“on”>2.1.1</st1:chsdate>.2002 (attached).


Thank you.
<o:p></o:p>

This seems to have worked

Thanks!