Click here to Skip to main content
15,881,852 members
Home / Discussions / C#
   

C#

 
GeneralRe: Days of the week Pin
kibromg13-Aug-07 5:18
kibromg13-Aug-07 5:18 
GeneralRe: Days of the week Pin
Justin Perez13-Aug-07 5:20
Justin Perez13-Aug-07 5:20 
AnswerRe: Days of the week Pin
Michael Potter13-Aug-07 4:57
Michael Potter13-Aug-07 4:57 
Questionhow I can get non-english letters from e-mail? Pin
Tsvi Girsh13-Aug-07 3:39
Tsvi Girsh13-Aug-07 3:39 
AnswerRe: how I can get non-english letters from e-mail? Pin
m@u13-Aug-07 6:57
m@u13-Aug-07 6:57 
GeneralRe: how I can get non-english letters from e-mail? Pin
Michael Sync13-Aug-07 16:12
Michael Sync13-Aug-07 16:12 
GeneralRe: how I can get non-english letters from e-mail? Pin
Tsvi Girsh13-Aug-07 22:58
Tsvi Girsh13-Aug-07 22:58 
QuestionProblem with Property Grid Pin
rajeevktripathi13-Aug-07 3:33
rajeevktripathi13-Aug-07 3:33 
Hi All

I am using PropertyGrid to show the properties of object..
want to use property grid with combo box and taking help from this MSDN link..
http://msdn2.microsoft.com/en-us/library/aa302326.aspx

here is the code that I am using..

<br />
<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Text;<br />
using System.ComponentModel;<br />
<br />
namespace PropertyGridTest<br />
{<br />
    [DefaultPropertyAttribute("Person")]<br />
    class Person : StringConverter<br />
    {<br />
        public Person(string inName, string inAddress, int inAge, bool inEmployed)<br />
        {<br />
            name = inName  ;<br />
            address = inAddress  ;<br />
            age = inAge ;<br />
            employed = inEmployed;<br />
        }<br />
<br />
<br />
        public Person(string inName)<br />
        {<br />
            name = inName;<br />
        }<br />
<br />
<br />
        private string name;<br />
        private string address;<br />
        private int age;<br />
        private bool employed;<br />
<br />
<br />
        public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)<br />
        {<br />
                        return true;<br />
        }<br />
        public override bool GetStandardValuesSupported(ITypeDescriptorContext context)<br />
        {<br />
            return true;<br />
        }<br />
<br />
        public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)<br />
        {<br />
            return new StandardValuesCollection(new string [] {"AAA", "BBB", "CCC", "DDD" });<br />
            <br />
        }<br />
<br />
        public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)<br />
        {<br />
            return false;<br />
        }<br />
<br />
       <br />
<br />
        [TypeConverter(typeof(Person)), <br />
        CategoryAttribute("Person Details"), DescriptionAttribute("Name of the Person")]<br />
        public string Name<br />
        {<br />
            get<br />
            {<br />
                return name;<br />
            }<br />
            set<br />
            {<br />
                name = value;<br />
            }<br />
        }<br />
<br />
        [CategoryAttribute("Person Details"), DescriptionAttribute("Address of the Person")]<br />
        public string Address<br />
        {<br />
            get<br />
            {<br />
                return address;<br />
            }<br />
            set<br />
            {<br />
                address = value;<br />
            }<br />
        }<br />
<br />
        [CategoryAttribute("Person Details"), DescriptionAttribute("Employed")]<br />
        public bool IsEmployed<br />
        {<br />
            get<br />
            {<br />
                return employed;<br />
            }<br />
            set<br />
            {<br />
                employed = value;<br />
            }<br />
        }<br />
<br />
        <br />
        [CategoryAttribute("Person Details"),<br />
        DescriptionAttribute("Age of the Person")]<br />
        public int Age<br />
        {<br />
            get<br />
            {<br />
                return age;<br />
            }<br />
            set<br />
            {<br />
                age = value;<br />
            }<br />
        }<br />
    }<br />
}<br />
<br />
<br />


and
<br />
<br />
private void radioButton1_CheckedChanged(object sender, EventArgs e)<br />
        {<br />
            if (radioButton1.Checked)<br />
            {<br />
                try<br />
                {<br />
                    Person person = new Person("John", "CA", 5, false);<br />
                    propertyGrid1.SelectedObject = person;<br />
                }<br />
                catch (Exception ex)<br />
                {<br />
                    MessageBox.Show(ex.Message);<br />
                }<br />
            }<br />
<br />


Now when i run the application then a exception is caught and the message is "Constructor on type PropertyGridTest.Person not found" is popped up,
also "Name" property is disabled.


Please help me to solve this problem..
that is how to show combobox in propertyGrid.

Please help me.


Thanks & Regards
AnswerRe: Problem with Property Grid Pin
leppie13-Aug-07 5:13
leppie13-Aug-07 5:13 
QuestionRe: Problem with Property Grid Pin
rajeevktripathi13-Aug-07 19:10
rajeevktripathi13-Aug-07 19:10 
QuestionBasic question about memory allocation Pin
A M SOMAN13-Aug-07 3:24
A M SOMAN13-Aug-07 3:24 
AnswerRe: Basic question about memory allocation Pin
blakey40413-Aug-07 3:26
blakey40413-Aug-07 3:26 
GeneralRe: Basic question about memory allocation Pin
A M SOMAN13-Aug-07 3:36
A M SOMAN13-Aug-07 3:36 
GeneralRe: Basic question about memory allocation Pin
blakey40413-Aug-07 3:39
blakey40413-Aug-07 3:39 
GeneralRe: Basic question about memory allocation Pin
N a v a n e e t h13-Aug-07 3:52
N a v a n e e t h13-Aug-07 3:52 
QuestionHow to connect to Remote PC using C# Coding? Pin
N a r e s h P a t e l13-Aug-07 3:20
N a r e s h P a t e l13-Aug-07 3:20 
AnswerRe: How to connect to Remote PC using C# Coding? Pin
Justin Perez13-Aug-07 3:24
Justin Perez13-Aug-07 3:24 
GeneralRe: How to connect to Remote PC using C# Coding? Pin
N a r e s h P a t e l13-Aug-07 3:32
N a r e s h P a t e l13-Aug-07 3:32 
GeneralRe: How to connect to Remote PC using C# Coding? Pin
Justin Perez13-Aug-07 3:45
Justin Perez13-Aug-07 3:45 
AnswerRe: How to connect to Remote PC using C# Coding? Pin
Michael Sync13-Aug-07 16:36
Michael Sync13-Aug-07 16:36 
QuestionHow to find the item that selected in ListView ? Pin
Yanshof13-Aug-07 3:09
Yanshof13-Aug-07 3:09 
AnswerRe: How to find the item that selected in ListView ? Pin
Justin Perez13-Aug-07 3:12
Justin Perez13-Aug-07 3:12 
AnswerRe: How to find the item that selected in ListView ? Pin
Giorgi Dalakishvili13-Aug-07 3:13
mentorGiorgi Dalakishvili13-Aug-07 3:13 
QuestionInstollation Solution Pin
Thaer Hamael13-Aug-07 2:56
Thaer Hamael13-Aug-07 2:56 
AnswerRe: Instollation Solution Pin
Justin Perez13-Aug-07 3:03
Justin Perez13-Aug-07 3:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.