You are not logged in.
This forum has been archived and no longer accepts new user registrations. Please report your questions, problems, and feedback to the issue page of ReoGrid on GitHub. Thank you for your cooperation.
Pages: 1
Topic closed
Hello Jing,
I would like to know what IsCellValid does? There is no information about this function because I am looking for better way to check for null data in the cells. I would assume it the cell would be valid no matter what because you create instance of cell when the worksheet is created.
all my code for null data is like this:
Even though I do not let alpha chars in some cells, but i still test for them.
If sheet.GetCellData("A1") IsNot Nothing Then
If IsNumeric(sheet.GetCellData("A1")) Then
'Code
End If
End if
Shane
Last edited by asparatu (2016-04-13 07:55:17)
Offline
IsCellValid is used to check whether or not a cell becomes invalid, when cell merged by other cell, it will become invalid, invalid cell cannot display text and styles. See:
https://reogrid.net/document/merge-and-unmerge/ Valid and invalid cells
To check and get a number, use Utility.CellUtility.TryGetNumberData, it returns a bool and double value result.
Dim number As Double
Dim isNumber As Boolean = Utility.CellUtility.TryGetNumberData(sheet.GetCellData("A1"), number)
Last edited by Jingwood (2016-04-14 01:39:53)
Offline
Hello Jing,
If the cell is nothing this will the TryGetNumberData handle it correctly or will it result in exception?
Shane
Offline
Yes, cell is null, isNumber is false and number is zero. The worksheet object also has method TryGetNumberData but it only receives row and column position.
Last edited by Jingwood (2016-04-14 09:18:27)
Offline
Hello Jing,
Ok..I understand.. Thank you
Shane
Last edited by asparatu (2016-04-15 02:05:27)
Offline
Pages: 1
Topic closed