473,568 Members | 3,014 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 2374
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...
2
16125
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
2511
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...
1
1914
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. ...
0
1128
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...
1
3116
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
1865
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
3793
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...
1
2998
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...
0
7917
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. ...
1
7665
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...
0
6277
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...
1
5501
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...
0
5217
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...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2105
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
1207
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
933
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...

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.