I have a column for decimal field values. I have set its format to #.#. So nothing shows when it a cell value is 0. This works great until one clear out all contents from the cell using Delete and tabs out of cell. That's when he gets the "value in editor is invalid" error message from Grid.
I am guessing there is some setting that would interpret a completely emptied out cell to mean "0". That way the system is happy with the numeric value and does not return the error.
Let me know the best way to to get around this problem.
Thanks!
Hi,
I don't think there's any way to stop the 0.0 from displaying once the cell goes into edit mode. 0 is, in fact, the value of the cell, so I don't see any way around that.
However... I tested this out using a MaskInput of "n.n" and a Format of "#.#" and I am able to blank out the contents of the cell and then leave the cell without any errors. So I'm not sure why that's not working for you.
My testing was done using v9.2 with the latest service release, so maybe you are using an older version and this is a bug that has since been fixed.
Mike,
The solution proposed did not work. I was previously using Format and not MaskInput. .Let me describe the problem again.
Requirement; We want the Grid to show only zero value cells as blanks. That keeps the grid from looking busy and helps users quickly notice the non-zero values. That was the reason for using a column format of #.#.
When I removed the Format of #.# and replaced it with MaskInput of "n.n", as you suggested, I ended up with 0's showing on cells that were previously blank.
Then I tried, using both Format as #.# and MaskInput as "n.n". That is no better.
As soon as I enter the blank cell i.e. a cell with 0 value, the cell goes into edit mode and shows 0.0. The left side picture shows you such a cell in edit mode.
Next, if user types a number in cell and tabs out, everything is fine.
However, if user clears out all contents of this cell by using delete key, then the cell shows "_._" shows due to the mask. You can see this on right side image.
If now user tabs out, I am guessing an invalid value is sent back and an an error shows. See image below.
You will notice that setting the format made the adjacent zero value cells are showing as blank because they is not in edit mode.
Desired behavior: Preserve the blank look of a zero value cell. When the delete clears out all values, make a 0 get saved back instead of the error.
.
I assume you mean MaskInput, not format. Format would have no effect when editing a cell.
Try using a MaskInput of "n.n" instead of "#.#", and that seems to work for me.