-
August 14th, 2009, 02:27 PM
#1
when casting from a number, the value must be a number less than infinity.
I have a datagrid where I am trying to remove only the first row where the barcode matches.
I had it working this way however it removed all of the matching barcodes instead of just the first one
dgItems.DataSource = ((List<Items>)dgItems.DataSource).Where(i => i.BarCode != barcodeProduct).ToList();
I switched it over to this however i am receiving the error when casting from a number, the value must be a number less than infinity.
Items foundPiece = ((List<Items>)dgItems.DataSource).First(i => (i.BarCode == barcodeProduct));
((List<Items>)dgItems.DataSource).Remove(foundPiece);
Any ideas?
-
August 14th, 2009, 02:33 PM
#2
Re: when casting from a number, the value must be a number less than infinity.
Try running it in the debugger and see what value its complaining about. I assume you have a double value somewhere that is the value of infinity. You need to find out what it doesn't like first, then find out why that value is infinity.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|