Welcome Guest Search | Active Topics | Sign In | Register

EO.Web.Grid 2008 Failing when empty value... Options
ddurango
Posted: Monday, June 27, 2011 10:38:08 AM
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.
eo_support
Posted: Monday, June 27, 2011 11:28:03 AM
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!
ddurango
Posted: Monday, June 27, 2011 12:00:36 PM
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.
eo_support
Posted: Monday, June 27, 2011 12:28:54 PM
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


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.