Sid Meier said:
dude I have a datagrid.
Say I have 3 rows of data.
Pr_code Name Cost Qty
4 HALO3 79 42
4 HALO3 79 42
4 HALO3 79 42
The code I have is a for loop that if a chkbox in one of the rows (eac row has a chkbox on the far left) is checked then delete the row from the datatable, refresh the datatable, gridview.databind() reloop and check the next row.
Say I want to delete rows 2 and 3.
It deletes row 2.
when it checks for the next row to delete it says it cannot find the next row.
Oh, is that all? No wonder you're having trouble, you're trying to apply Fortran indexing to a C problem. If you'd been this specific about the problem before, I'd have been able to help you a long while ago. (Which incidentally shows the importance of asking questions in the right way; "It doesn't work" is totally unhelpful.)
Anyway, to get back to your problem; given three rows, the first row is row 0, the second row is row 1, the third row is row 2. So, deleting row 2 deletes the last row, and then there aren't any more rows beyond that. Let me expand your table a bit:
Code:
Pr_code Name Cost Qty Fortran-index C-index
4 HALO3 79 42 1 0
4 HALO3 79 42 2 1
4 HALO3 79 42 3 2
You want to use the C, not Fortran, index. I'll throw in another piece of advice for free: Make your rows different, like this:
Code:
Pr_code Name Cost Qty Fortran-index C-index
4 HALO3 79 42 1 0
4 HALO2 40 38 2 1
4 HALO1 10 2 3 2
If you had done this, you'd have been able to see which row was being deleted, and debugged a lot faster.
As for you, Ego, as you must know there is a difference between being rude, and being so rude that a moderator needs to step in. I am giving you fair warning, however, that this does not apply in our game; I will step in even for small rudenesses.
Apart from that, though, I would ask that you consider this. I am not saying this just to pick on you, or just because I'm the GM and can do it, or just because I'm evil and twisted. I am saying it because I genuinely do believe that your posts are making an atmosphere of confrontation in our game, that native speakers of English really are insulted by what you post even when it doesn't look offensive to you, and that there is a danger of some people (including me!) quitting over your attitude. This is not a question of your taste versus my taste. This is
roughly 50% of the players who have
trouble having fun because of you.
As for your "I just asked X", it won't wash. You quite simply aren't a native speaker of English, and you need to realise that it is quite possible to insult people even when the dictionary, or the literal Portuguese translation, looks totally ok. I agree that in the literal sense you asked "Why can't you use VB", but as a matter of fact, your words mean "Are you so stupid you can't use VB?"
Please believe that I am not saying this sort of thing just to have a flamewar with you. I'm saying it because you actually are spoiling the game for a lot of people, probably without meaning it, and I think it's possible for you to stop. Also because, if you don't stop, you will be banned from our game. It really will happen, Ego. No amount of saying "If you can't take this, go elsewhere" is going to help, because
a) Lurken and Sterk agree with me, and we have the power in this game
b) Several other players have made similar complaints.
I don't like to make threats, but these are the facts on the ground. You can dislike them; you can say it shouldn't be that way. But the facts remain, and if you don't adapt and play the game our way, then we simply won't play with you.
I know you are going to say I'm only threatening this because I'm afraid of Leon. I can't prove otherwise, to be sure - except that if you drop or are banned, another player will take up Leon. Probably MangoMan, since he was first in the queue. But consider:
Even if I'm only afraid of Leon and looking for an excuse, you are in fact giving me the excuse I need. Do you really want to give me that satisfaction? You must know that if I were to ban you on grounds that most of the players found ridiculous, the game would collapse. So, even on the assumption that I'm an evil bastard who would use GM powers for ingame purposes, I still need a reason. Don't give me that reason. Please.