473,614 Members | 2,342 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"Operation is not valid because it results in a reentrant call to the SetCurrentCellA

1 New Member
Hi, I have a datagrid of one column and many rows. Cell become editable when i click on the cell. i have a stutation in which if i edit the cell value to zero and click on the next cell then leaving cell (0.00) should be remove at that location. But movement i click on next cell cellEditEnd methos gets called and in this method i have written the code to remove the cell. But when it try to remove the cell but code datagrid.rows.R emoveAt(index) then exception throws "Operation is not valid because it results in a reentrant call to the SetCurrentCellA ddressCore function".While googling i found many workaround for this case e.g Using beginivoke method with deegate or set focus some aother controls or Disbale the grid before the remove cell. But i didn't got the solution. Exception throws when removing the rows from the grid. Below is stack trace:

---> System.InvalidO perationExcepti on: Operation is not valid because it results in a reentrant call to the SetCurrentCellA ddressCore function.
at System.Windows. Forms.DataGridV iew.SetCurrentC ellAddressCore( Int32 columnIndex, Int32 rowIndex, Boolean setAnchorCellAd dress, Boolean validateCurrent Cell, Boolean throughMouseCli ck)
at System.Windows. Forms.DataGridV iew.OnRemovingR ow(Int32 rowIndexDeleted , Point& newCurrentCell, Boolean force)
at System.Windows. Forms.DataGridV iewRowCollectio n.RemoveAtInter nal(Int32 index, Boolean force)
at System.Windows. Forms.DataGridV iewRowCollectio n.RemoveAt(Int3 2 index)
MY code is simmilar at below:

private void grdListItems_Ce llEndEdit(objec t sender, DataGridViewCel lEventArgs e)
{
if (cellAmt == 0)
{
RemoveZeroDolla rEntry(e.RowInd ex);
}
}
And
private void RemoveZeroDolla rEntry(int rowIndex)
{
do something...
grdListItems.Ro ws.RemoveAt(row Index);
}
Can any one give the correct solution? please. For googling i have went to below location http://social.msdn.mic rosoft.com/forums/en-US/winformsdatacon trols/thread/f824fbbf-9d08-4191-98d6-14903801acfc/ http://blogs.dotnetner ds.com/steve/archive/2007/05/17/DataGridView-Reentrant-Call-Nightmare.aspx
_______________ _______________ __________
Dec 2 '11 #1
0 1768

Sign in to post your reply or Sign up for a free account.

Similar topics

0
729
by: Martin B | last post by:
Hallo to everyone! Problem: -------- GridView Exception: reentrant call to the SetCurrentCellAddressCore function System: ------- WinXP Professional, english, .NET Framework 2.0 Beta Language C#
6
11038
by: junky_fellow | last post by:
what are reentrant functions? What are the characteristics of a reentrant code ? what things should be kept in mind while writing a reentrant code ?
28
2016
by: romy | last post by:
What's the easiest way to verify the user had entered a valid date ?
9
8285
by: TheOne | last post by:
Would anyone please point me to a list of reentrant C library functions? I want to know which C library functions are safe to use inside a signal handler across all platforms. Does GNU C library make few other functions reentrant on Linux platform? I have searched a lot on the web for it but without any success. Man page of signal(2) has listed system calls (POSIX 1003.1-2003 list) which are safe(reentrant) but thats not sufficient for...
13
26591
by: mitchellpal | last post by:
i am really having a hard time trying to differentiate the two..........i mean.....anyone got a better idea how each occurs?
0
6779
by: news.microsoft.com | last post by:
I got this error when i bind dataview to datagridview data.Datasource= dt.DataView Error: Operation is not valid because it results in a reentrant call to the SetCurrentCellAddressCore function Does any one has solution for this?
24
6568
by: John | last post by:
I know this is a very fundamental question. I am still quite confused if the program call stack stack should always grows upwards from the bottom, or the opposite, or doesn't matter?? That means the stack pointer should go upwards when there are "push" operations, and stack pointer should go downards when there are "pop" operations?? If this is the case, the address should go upwards (increasing) or downards (decreasing) then? i.e....
8
36115
by: hoofbeats95 | last post by:
I don't think this should be this complicated, but I can't figure it out. I've worked with C# for several years now, but in a web environment, not with windows form. I have a form with a query button on it. If the query returns multiple results, a new window is opened with a grid containing the results. When the user double clicks on the desired row in the grid, I want the first form to populate with the correct data. I don't know how...
1
2029
by: dearprasan | last post by:
Hi, I am making a call to a asynchronous call to a webservice using callback. Before I make the asynchronous call, I am allowed to make the following cast: IHTMLDocument2 doc = (IHTMLDocument2) this.WebBrowser1.Document.Domdocument; But after the asynchronous call is made, and its callback procedure is handled, i get "Specified cast not valid" exception while I try to do the same cast as above. I can also see that the object attributes...
0
4247
by: ANILMOURYA | last post by:
private void FlexGrdRsltConv_CellEnter(object sender, DataGridViewCellEventArgs e) { if (blnRowenter) { return;} if (FlexGrdRsltConv.Columns.Name == "TxtEltCode") { DataGridViewComboBoxCell RowComboColumn = new DataGridViewComboBoxCell();
0
8640
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8589
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8443
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7114
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5548
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4058
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2573
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1438
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.