Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 2.0 and Visual Studio. 2005 > Visual Studio 2005
|
Visual Studio 2005 For discussing Visual Studio 2005. Please post code questions about a specific language (C#, VB, ASP.NET, etc) in the correct language forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Studio 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 11th, 2006, 05:51 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default Events with StringCollectionEditor, how?

Hey everybody...

I have a hard time figuring out how to provide design-time integration for a List<string> with the StringCollectionEditor applied. When in the editor I can add the items, and everything is working beutifully, but I cannot find a way to notify the designer or the other properties to update with the changes in the string list.

If e.g. a ListBox is put on a form, the Items can be edited using an ListControlStringCollectionEditor, which is derived from StringCollectionEditor. After adding each item the UI is updated in the designer. I want to catch an event from adding an item or actully I would also be statisfied with the event of adding the entire list.

How can I connect with events (if any at all) from a UITypeEditor as the StringCollectionEditor?

The Editor, which I am using for my generic list...
Code:
[Editor("System.Windows.Forms.Design.StringCollectionEditor, System.Design", 
    "System.Drawing.Design.UITypeEditor, System.Drawing")]
    I have tried the RefreshProperties attribute on the generic list property with no luck, and I think it is because the UI editor uses the Add method of the list, and therefore not the set-part, right?

Thanks a lot, Jacob.
__________________
Danish audio books for download at http://www.lytenbog.dk (Danske lydbøger til download).
 
Old April 11th, 2006, 06:01 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Through the Reflector I found that the StringCollectionEditor uses a StringCollectionForm, which has an OnEditValueChanged implemented, but how do I hook up to this one from inside a class where I do not got hold on the instance of the editor??!

Thanks, Jacob.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Events bschleusner C# 2005 2 February 26th, 2007 05:25 AM
Page Events aware Javascript 2 November 8th, 2006 07:01 AM
Events not firing in IE malk ASP.NET 1.0 and 1.1 Professional 7 August 29th, 2006 01:32 PM
Calling Events. rupen Javascript How-To 3 August 8th, 2005 05:15 AM
help with Events egiblock JSP Basics 0 October 6th, 2003 11:39 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.