Click here to Skip to main content
15,914,066 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello every one..!!

C#
foreach (GridViewRow gr in grvCourierBillPassing.Rows)
            {



i have used above goreach gridviewrow loop ....i have kept a debugging point inside it...it is seen that it is being hit twice for each row...

Kindly help me out..!!

[edit]Spurious tags removed - OriginalGriff[/edit]
Posted
Updated 6-Mar-12 6:01am
v4

Assuming that grvCourierBillPassing is a standard GridView, then that is very unlikely - I would suspect that you are mistaken for some reason. If what you said was true for all GridViews, it would have been noticed in the last five years or so.

Instead, I suspect that the fault lies in your code within the loop - which we can't see.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 7-Mar-12 0:42am    
That would be my guess too, my 5.
I actually offered the simple way how to find it out in a regular way -- please see my answer.

(It feels so moving -- someone voted 4 for both our answers. It looks like we would get 5 if we pointed out a miraculous hidden grid view method setting some hidden property like "don't fire twice" :-)

I recently noted another funny observation from out inquirers: someone gets a compiler message like "You cannot do operation A". What's the most typical question in this case, usually put in the question's title? Of course, something like "How to do operation A?" (!!) Very moving childish logic! :-))

--SA
vaibhav mahajan 14-Mar-12 7:18am    
looks like difference between 4 and 5 matters u a lot..;-)
While debugging, open the debug window "Call stack" to see where it comes from. This is easy.

Good luck,
—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900