Click here to Skip to main content
15,902,445 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to work on Mobile Banking(SMS Banking)? Pin
CoderForEver10-May-10 4:18
CoderForEver10-May-10 4:18 
GeneralRe: How to work on Mobile Banking(SMS Banking)? Pin
Michel Godfroid10-May-10 5:10
Michel Godfroid10-May-10 5:10 
GeneralRe: How to work on Mobile Banking(SMS Banking)? Pin
CoderForEver10-May-10 7:24
CoderForEver10-May-10 7:24 
GeneralRe: How to work on Mobile Banking(SMS Banking)? Pin
Michel Godfroid10-May-10 11:15
Michel Godfroid10-May-10 11:15 
GeneralRe: How to work on Mobile Banking(SMS Banking)? Pin
CoderForEver20-May-10 7:38
CoderForEver20-May-10 7:38 
QuestionDataGridView and Deleting Rows Pin
Member 368144310-May-10 2:09
Member 368144310-May-10 2:09 
AnswerRe: DataGridView and Deleting Rows Pin
Heinzzy10-May-10 2:25
Heinzzy10-May-10 2:25 
AnswerRe: DataGridView and Deleting Rows Pin
Luc Pattyn10-May-10 2:32
sitebuilderLuc Pattyn10-May-10 2:32 
When you delete an item in a list, any list, the indexes of the remaining items may change. There are two easy ways to cope with that:

1. not moving at all: assuming a range of items may have to be deleted, if the first item the be deleted is at index x, use RemoveAt(x); and continue testing for more removals at the same index x, as each removal there will decrement the index of all the # subsequent items by one.

2. working backwards: first determine the range to be deleted, without actually deleting anything; then delete from high index to low index; this also works when the items of interest aren't consecutive.

Beware, whatever you choose to do, a foreach will fail as an enumerator becomes invalid (and will throw an exception) when the collection gets modified.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

If you want my opinion or comment, ask in a forum or on my profile page; I will not participate in frackin' Q&A

Questionsort by Pin
tanzeel8510-May-10 2:02
tanzeel8510-May-10 2:02 
AnswerRe: sort by Pin
Henry Minute10-May-10 5:27
Henry Minute10-May-10 5:27 
GeneralRe: sort by Pin
tanzeel8513-May-10 1:11
tanzeel8513-May-10 1:11 
AnswerRe: sort by Pin
Peace ON10-May-10 20:12
Peace ON10-May-10 20:12 
Questionreturn type error "not all code paths return a value" Pin
wjbjnr10-May-10 0:42
wjbjnr10-May-10 0:42 
AnswerRe: return type error "not all code paths return a value" Pin
nagendrathecoder10-May-10 0:53
nagendrathecoder10-May-10 0:53 
AnswerRe: return type error "not all code paths return a value" [modified] Pin
Pete O'Hanlon10-May-10 0:57
mvePete O'Hanlon10-May-10 0:57 
QuestionRe: return type error "not all code paths return a value" Pin
wjbjnr10-May-10 4:31
wjbjnr10-May-10 4:31 
AnswerRe: return type error "not all code paths return a value" Pin
Alan N10-May-10 5:38
Alan N10-May-10 5:38 
AnswerRe: return type error "not all code paths return a value" Pin
Som Shekhar10-May-10 1:02
Som Shekhar10-May-10 1:02 
QuestionRe: return type error "not all code paths return a value" Pin
wjbjnr10-May-10 5:25
wjbjnr10-May-10 5:25 
AnswerRe: return type error "not all code paths return a value" Pin
Som Shekhar10-May-10 5:35
Som Shekhar10-May-10 5:35 
GeneralRe: return type error "not all code paths return a value" Pin
wjbjnr10-May-10 6:15
wjbjnr10-May-10 6:15 
GeneralRe: return type error "not all code paths return a value" Pin
Som Shekhar10-May-10 6:48
Som Shekhar10-May-10 6:48 
QuestionRe: return type error "not all code paths return a value" Pin
wjbjnr10-May-10 7:59
wjbjnr10-May-10 7:59 
AnswerRe: return type error "not all code paths return a value" Pin
Som Shekhar10-May-10 8:03
Som Shekhar10-May-10 8:03 
GeneralRe: return type error "not all code paths return a value" Pin
wjbjnr10-May-10 8:43
wjbjnr10-May-10 8:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.