Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Add unique values to collection editor
 

Add unique values to collection editor

Hi,

In my application I have a collection class which inherits collection base. This object is added to the propertygrid. on clicking the ellipses button in propertygrid, I got the CollectionEditor. 

My collection wants to restrict values so that I can add unique values only to some members. How can I made that restriction to that. 

I need to do the validation on Ok button click of the editor. 

In another scenario I want to disable the add button. How can I do this? 

Can any body tell me a way to solve the problems? Expecting results soon. 


Gowrisankar. 
MigrationUser 1  Wednesday, May 25, 2005 9:09 AM
I think you need to throw an exception in your Add method if the collection already contains the new value.
MigrationUser 1  Sunday, May 29, 2005 10:48 PM

You can use google to search for other answers

Custom Search

More Threads

• how to redraw titlebar and borderframe
• How to generate "this.components = new System.ComponentModel.Container();" for component ?
• AutoScaleMode Property does not exist
• Form Designer at runtime
• VS.NET designer support for collections
• Easy Question: new Table() and new Label()
• Moving from Java to C#
• Printing controls
• How can I make my user control take my other controlslike a panel
• Prevent TextBox From Changing SelectionStart (Caret) With Mouse