ListView Designer Problem

Hi,

I have an app with a limited designer.

I need to somehow be notified when the number of Items in a ListView changes (in order to implement Undo)

Here's what I have tried so far:
1) The Items collection has no collection events.
2) The PropertyGrid DOES NOT fire PropertyValueChanged events when the Items are edited via a CollectionEditor.
3) There does not appear to be any event in the ListView to notify me when the collection has changed.
4) There is no way to have the PropertyGrid notify me when an editor has started / stopped editing.
5) ListView SelectedIndexChanged does not help.
6) IComponentChangeService in my DesignerHost does not help.

Does anybody know how to do this  

Is there an event in ListView that does not show up in intelliprompt that would help me out  

Is there a callback in the Designer arena that will help me

The same is true for ListBox.

Thanks,
Greg


Answer this question

ListView Designer Problem

  • Stefano B

    Hi Ursus,

    Thank you for your post.  I will experiment with the designer transactions and let you know.

    -Greg

  • valko

    I've recently been exploring a code example that makes use of the DesignerHost interface. The main display form derives from IDesignerHost and UserControl, which gives it alot of functionality but is fairly complex to implement. You might look at this: http://msdn.microsoft.com/library/default.asp url=/library/en-us/cpref/html/frlrfsystemcomponentmodeldesignidesignerhostclasscreatetransactiontopic.asp
    The MSDN article I'm working through is probably overkill for what you are doing, but there is a useful source code download, and alot of useful information. I didn't even know many of these .NET classes existed until I'd read the article. Here's the location: http://msdn.microsoft.com/msdnmag/issues/04/12/CustomFormsDesigner/default.aspx

  • RamsBangalore

    Hi,

    The problem I'm running into is that there does not seem to be any way for my code to be notified when the user is editing via a CollectionEditor.

    There is no CollectionEditorBegin or CollectionEditorEnd event.  There does not appear to be any callback within the Designer framework for letting me know that changes made to a ListView's items are occurring.  The PropertyGrid does not appear to have any useful events.

    Maybe if I could know that something is getting edited, then I could use a DesignerTransaction.

    I don't want to make my own ListView class because I want to have a generic Designer.

    Does anyone know how to make this work   I'm guessing there is some Designer callback out there that is used to support my needs, but I can't find it.

    Thanks,
    Greg


  • ListView Designer Problem