index out of range error upon closing collectionEditor?


Henry J.

Has anybody run into this index out range exception when opening and
then closing a collectionEditor 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 CollectionEditor
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 CollectionEditor.
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 CollectionEditor. 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!



Stoitcho Goutsev \(100\)


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.


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question