|
Rank: Member Groups: Member
Joined: 11/16/2007 Posts: 18
|
Hi, I upload an excel file into an EO.Grid, then I go and loop through each EO.Web.GridItem with no problems in previous version (EO.Web.dll 5.0.35.2).
On a recent update to version 2008 (6.0.86.2) I noticed when I interact through the EO.GridItem if a cell has not value will throw an exeption (object not reference...)
EO.Web.Grid grDis = (EO.Web.Grid)Grid1; EO.Web.GridItemCollection gCol = grDis.Items; foreach (EO.Web.GridItem gr in gCol) { EO.Web.GridCellCollection gCell = gr.Cells; if (gCell[1].Value.ToString().Length > 0) { dler = gCell[1].Value.ToString(); last = gCell[2].Value.ToString(); home = gCell[7].Value.ToString(); cell = gCell[9].Value.ToString(); con++; break; } }
Also, it seems not recognized the last item of the grid causing to continue go through the rows. My concern is why this will work on previous version and now it doesn't. Please advice.
Thanks.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
This is normal. You should check whether the cell's Value property is null before calling ToString.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 11/16/2007 Posts: 18
|
No, I don't think you understand my complaint. I know it is normal to check for null values but why previous version will automatically will return a empty string when using the ToString method and now new version will throw and exception.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
I believe the old version did not distinguish null value and empty value and the new version did because some users wanted to find out which cell has been edited.
Thanks
|
|