|
-
September 2nd, 2009, 09:22 AM
#1
DataGridView ignore index out of bounds
Is there a way to force my application to ignore the index out of bounds error from the DataGridView? I have gone through from top to bottom and there is no reason why I should be receiving this error. No operations, rows, nor columns are affected by just continuing past the error.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
September 3rd, 2009, 12:50 AM
#2
Re: DataGridView ignore index out of bounds
The following is actually bad advice.
You could add a Try and catch block, and provide nothing in the catch section, as in :
Code:
Try
' Your Code Here
Catch ex As IndexOutOfBoundsException
'Do Nothing Here, Leave Empty!
End Try
Now, whenever you get this exception, it gets "skipped", because we said nothing should happen when it occurs.
The whole reason why I said it is bad advice actually, is because, this type of exception may influence other parts of your code / program.
You said :
and there is no reason why I should be receiving this error
This is where the Good advice comes in
There is always a reason for an error, sometimes it may just not be very obvious, I'd actually recommend having a closer look at all the particular code, propertis set etc.
I hope my comments wre useful... And Good luck!
-
September 3rd, 2009, 08:15 AM
#3
Re: DataGridView ignore index out of bounds
Here's my exact predicament...it makes no sense to me.
- I have a CSV file which loads to a DataGridView perfectly fine. No error whatsoever.
- If I click a column so that it sorts, I receive the error.
- However, if I click another column so that the sort order (asc, desc) is the same, but the column is different, I don't see the error again.
- But, it seems that the moment asc or desc is changed, that's when I receive the error.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
September 3rd, 2009, 08:25 AM
#4
Re: DataGridView ignore index out of bounds
What code do you use for Sorting, did you write your own custom code ¿
-
September 3rd, 2009, 08:25 AM
#5
Re: DataGridView ignore index out of bounds
No custom code whatsoever. I just let the DataGridView handle it, itself.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
September 3rd, 2009, 08:27 AM
#6
Re: DataGridView ignore index out of bounds
Interesting ... 
Is it possible to add your CSV file and form with the DGV on it here, your project / smaller representation of it ¿
-
September 3rd, 2009, 08:32 AM
#7
Re: DataGridView ignore index out of bounds
Unfortunately, I cannot. It is a sensitive document. The whole things is based upon login information and accounts. I would pretty much have to create a fake one to do so.
Here's the format: firstname, lastname, username, password, email, address, phone, datecreated, dateexpires
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
September 3rd, 2009, 08:34 AM
#8
Re: DataGridView ignore index out of bounds
I have an idea...I'm going to remove the last line return of the document. Since I am temporarily adding to each line as it is read into the DataGridView, I bet this is creating a problem.
I'll post back as soon as I try it.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
September 3rd, 2009, 08:35 AM
#9
Re: DataGridView ignore index out of bounds
OK, no prob .
Last question ( sorry for all these questions, I'm just trying to narrow down the issue )
Does it always happen with the same column, or does it happen with any of these columns ¿
-
September 3rd, 2009, 08:58 AM
#10
Re: DataGridView ignore index out of bounds
Can happen on any column so long as the asc/desc is changed.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
September 3rd, 2009, 06:21 PM
#11
Re: DataGridView ignore index out of bounds
Can you explain this a little better?
* If I click a column so that it sorts, I receive the error.
* However, if I click another column so that the sort order (asc, desc) is the same, but the column is different, I don't see the error again.
* But, it seems that the moment asc or desc is changed, that's when I receive the error.
Sort EMAIL to ASC. Error
Change NAME ... ? (was unsorted before, right)
Thanks
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
|