ReoGrid Forum

Fast and powerful .NET Spreadsheet Component

You are not logged in.

Announcement

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.

https://github.com/unvell/ReoGrid/issues

#1 2016-04-13 07:50:48

asparatu
Member
Registered: 2014-08-20
Posts: 196

What does IsCellValid do?

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

#2 2016-04-14 01:39:19

Jingwood
Moderator
From: jing at reogrid.net
Registered: 2014-06-03
Posts: 615

Re: What does IsCellValid do?

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

#3 2016-04-14 04:41:38

asparatu
Member
Registered: 2014-08-20
Posts: 196

Re: What does IsCellValid do?

Hello Jing,
   If the cell is nothing this will the TryGetNumberData handle it correctly or will it result in exception?
Shane

Offline

#4 2016-04-14 08:53:10

Jingwood
Moderator
From: jing at reogrid.net
Registered: 2014-06-03
Posts: 615

Re: What does IsCellValid do?

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

#5 2016-04-14 12:20:42

asparatu
Member
Registered: 2014-08-20
Posts: 196

Re: What does IsCellValid do?

Hello Jing,
   Ok..I understand.. Thank you

Shane

Last edited by asparatu (2016-04-15 02:05:27)

Offline

Board footer

Powered by FluxBB