2 Replies Latest reply on Apr 6, 2014 6:52 PM by ThinkingThings

    Cell.Contents incorrectly resolve to empty Strings if in Overset Condition… Is this a Bug or Me?

    ThinkingThings Level 1

      Greetings, Folks.


      This is driving me nuts. I can replicate the problem over and over again. Am I missing a reason why cell.contents would be evaluated differently if in overset condition than not? I don't get it…


      Here's the scenario. CS6, Win7, VB.Net (but the logic is easy so stay with me…).

      Object in question is a 3 cell row containing values in the respective cells: Text value, double value, double value.


      Here's the problem code. (gitc=1 in all these test cases)

      If Not HasValue(curRow.Cells(gitc + 1).Contents) Then


      Here's the simple function called by the line above:

      Private Function HasValue(value As Object) As Boolean

         If IsDBNull(value) OrElse value = "" Then Return False Else Return True

      End Function


      Here's the problem. The code works as intended provided that the referenced row is not in overset condition, the object resolves to a text value and two double values, from which the function returns the proper evaluation. But if the row is in overset condition, the object resolves to three empty Strings ("") and consequently the function returns the wrong evaluation.


      Here the rub. If I take lengthen (or shorten) the column which puts a DIFFERENT row in the overset place, the same result occurs to that different row, so I know that it is not the values.


      Sorry for the long explaination, but I felt that it is important to give as much info as possible when asking for help.


      Thank you very much for any help and/or insight.