Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / Design Time / February 2006

Tip: Looking for answers? Try searching our database.

Displaying a form to accept user input from a property in property grid (custom TypeConverter??)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mav - 01 Feb 2006 00:38 GMT
This is what I want to do and I am struggling with it:
I have a property which gets displayed in the property grid and when
the user clicks on it, a form shows up which allows the user to select
multiple email id's and when he clicks OK, the list should be displayed
for the property as a comma seperated string.
I am not able to even show the form currently. This is what I have:
property displayed in grid:
private EMailUserList to;
       public EMailUserList To
       {
           get
           {
               return to;
           }
           set
           {
               to = value;
           }
       }

EMailUserList consist of:
public class EMailUsers
   {
       private string emailList = default(string);
       public string EMails
       {
           get
           {
               SelectUsers users = new SelectUsers();
               if (users.ShowDialog() == DialogResult.OK)
               {
                   emailList = users.EMailList;
               }
               else
                   emailList = String.Empty;
               return emailList;
           }
           set
           {
               emailList = value;
           }
       }

       public override string ToString()
       {
           return emailList;
       }
   }

and SelectUsers is the form.

Also if I have a property which returns an Array/ArrayList i can see
the button with 3 dots coming up in property grid, which I don't get,
how do I achive this.

I know I am doing something very wrong and might have to write a type
converter but I am not able to even figure out what type converter to
write and where?
Thanks a bunch,
Mav.
jokiz - 01 Feb 2006 15:10 GMT
what you need is a UITypeEditor, read about them here:
http://www.awprofessional.com/articles/article.asp?p=169528&rl=1
Mav - 01 Feb 2006 18:36 GMT
Thanks a lot this was helpful jokiz. I have to implement a UITypeEditor
and a TypeConverter as well to achive what I want to do.
Also, is there a way to disable direct user input into the property
(keyboard) but only allow values to be selected thru the Editor.
jokiz - 02 Feb 2006 02:38 GMT
perhaps when you provide your own typeconverter, you can allow
conversions from your type to string (to display in property grid,
comma separated) but disable the conversion from string (input from
grid) to your type, explore on the canconvert functions...

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.