473,698 Members | 2,833 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

index out of range error upon closing collectionEdito r?

Has anybody run into this index out range exception when opening and
then closing a collectionEdito r from within a PropertyGrid?

I use PropertyGrid to edit configurations in my application. One of
the fields is a collection. I can expand or collapse the collection in
the PropertyGrid fine. However,if I open the CollectionEdito r
associated with the collection, do nothing, and just close it, I get
an index out of range error. Note that I get this error only when I
have the collection expanded inside the PropertyGrid. If I collapse
the collection inside the PropertyGrid, I don't get the error.

I didn't modify the behanviors of the PropetyGrid and CollectionEdito r.
There seems to be no way to catch the above exception. I tried to
collapse the collection inside the PropertyGrid upon the EditValue
event in the CollectionEdito r. But I got other tough exception. Sorry
my application is too complex to post a stripped down version here.

This error is quite annoying. I'm hitting wall in order to fix it.
Any tips would be greatly appreciated!

May 16 '06 #1
2 2379
Henry,

Did you write the collection editor by yourself or you use the one that
comes with the framework?

There was a bug in .NET 1.x (I don't know if it was fixed in 2.0) where if
there is a expandable node which also has modal editor (ellipsis button) and
one click on the ellipsis while the node is expanded the property grid
crashes very baddly. The solution was to collapse the node before openning
the modal editor.
--

Stoitcho Goutsev (100)

"Henry J." <ta********@yah oo.com> wrote in message
news:11******** *************@j 55g2000cwa.goog legroups.com...
Has anybody run into this index out range exception when opening and
then closing a collectionEdito r from within a PropertyGrid?

I use PropertyGrid to edit configurations in my application. One of
the fields is a collection. I can expand or collapse the collection in
the PropertyGrid fine. However,if I open the CollectionEdito r
associated with the collection, do nothing, and just close it, I get
an index out of range error. Note that I get this error only when I
have the collection expanded inside the PropertyGrid. If I collapse
the collection inside the PropertyGrid, I don't get the error.

I didn't modify the behanviors of the PropetyGrid and CollectionEdito r.
There seems to be no way to catch the above exception. I tried to
collapse the collection inside the PropertyGrid upon the EditValue
event in the CollectionEdito r. But I got other tough exception. Sorry
my application is too complex to post a stripped down version here.

This error is quite annoying. I'm hitting wall in order to fix it.
Any tips would be greatly appreciated!

May 16 '06 #2
I have found some more info on this problem. It is a Microsoft bug by
this MSDN article:

http://support.microsoft.com/default...b;en-us;890950

And comments to this article:

http://www.codeproject.com/cs/miscct...ectiondata.asp

contains various workarounds for the bug.

May 17 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
492
by: m. pollack | last post by:
Hi all I've been using the PropertyGrid to allow the user to edit a class object at runtime. The class object contains a custom strongly-typed collection, and I have written a subclass of CollectionEditor to manipulate it, using an EditorAttribute on the collection class to associate the collection with my custom Editor subclass. The Collection Editor has its own little PropertyGrid, which displays the properties of the selected member of the...
2
16130
by: kscdavefl | last post by:
When I run the following code: private void applicationPermissionGrid_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) { if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item || (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem)) {
1
2529
by: Clark Choi | last post by:
I ran the sample application called Petstore from msdn. Everything went fine until I tested Update button on the web form to update the database through Datagrid. I have been searching the web to track down this error, but none of them really explain this problem/solution very well. I tried hard to debug this, but debuggin itself was impossible. The error message is as follows:
1
1932
by: Dave | last post by:
I'm getting the following error on an EditCommand event. This code is running on production web farm and the thing is it doesn't happen all the time. If I get this error, click the back button, and try again it works. Sometimes it works the first time in. I tried to step through the debugger running locally but I can't duplicate it. Server Error in '/' Application. ---------------------------------------- Index was out of range. Must...
0
1143
by: Bardo | last post by:
Hi all, I am having an issue with a custom CollectionEditor. My scenario is as follows: I have a base type TypeA. I also have a TypeACollection. The TypeACollection has an Editor attribute of TypeACollectionEditor. This collection editor derives from the framework CollectionEditor, passing TypeACollection in the constructor to indicate which type it deals with. I then have TypeB, which derives from TypeA, but adds specific
1
3121
by: Ashok2007 | last post by:
Hi, I've a form and the form is working fine also. But my problem is Whenever I closed the form. I'm getting two errors. 1.Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 2.Arithmetic overflow error converting varchar to data type numeric. The statement has been terminated.
6
1879
by: mattmao | last post by:
Hi all. There is a challenge question I encountered recently, which says: "In plain English, there are six different ways when you want to tell someone else about the current time: It is five past seven. It is eleven to ten. It is half past nine. It is a quarter past eight. It is a quarter to ten.
7
3803
by: colin | last post by:
Hi, I have my property editor wich uses the pop up collection editor for arrays etc, but i have had to use a generic wrapper for the elements in some types of collections. although the editing actually works well, and I can set the name ok in the primary property editor, this makes a mess of the type name displayed in the pop up colection editor, is there any way to change this ?
1
3005
by: =?Utf-8?B?SkI=?= | last post by:
Hello As I debug the C# code with a break point and by pressing F11 I eventually get a message stating: ContextSwitchDeadlock was detected Message: The CLR has been unable to transition from COM context 0x17aeb8 to COM context 0x17abd8 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long running operation without pumping Windows messages.
0
8611
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9170
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
9031
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...
1
8904
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7741
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...
1
6531
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4372
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...
0
4624
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2007
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.