Click here to Skip to main content
15,900,973 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
DataRowView drv = dgvSalary.CurrentItem as DataRowView;
if (drv == null) return;
               try
               {
                   drv["Check"] = false;
                   drv.EndEdit();
               }
               catch (StackOverflowException ex)
               {

               }



In Above Code Line Bold I Getting "An unhandled exception of type 'System.StackOverflowException' occurred in PresentationFramework.dll"

DataView = Cannot evaluate expression because the current thread is in a stack overflow state.



How to solve it
Posted
Updated 21-Aug-13 23:02pm
v2
Comments
thatraja 22-Aug-13 5:36am    
while debugging, are you getting any value in drv before the line "drv["Check"] = false;"

1 solution

Nobody will help you based on this code. It doesn't show what happens behind the scene.
Debug it. Search, what code is called when you assign false - maybe your app has subscription on this change and does some other actions which result in infinite loop. Maybe you do that recursively, etc..
 
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