Click here to Skip to main content
14,870,673 members
Home / Discussions / C#
   

C#

 
GeneralRe: Days of the week Pin
kibromg13-Aug-07 5:18
Memberkibromg13-Aug-07 5:18 
GeneralRe: Days of the week Pin
Justin Perez13-Aug-07 5:20
MemberJustin Perez13-Aug-07 5:20 
AnswerRe: Days of the week Pin
Michael Potter13-Aug-07 4:57
MemberMichael Potter13-Aug-07 4:57 
Questionhow I can get non-english letters from e-mail? Pin
Tsvi Girsh13-Aug-07 3:39
MemberTsvi Girsh13-Aug-07 3:39 
AnswerRe: how I can get non-english letters from e-mail? Pin
m@u13-Aug-07 6:57
Memberm@u13-Aug-07 6:57 
GeneralRe: how I can get non-english letters from e-mail? Pin
Michael Sync13-Aug-07 16:12
MemberMichael Sync13-Aug-07 16:12 
GeneralRe: how I can get non-english letters from e-mail? Pin
Tsvi Girsh13-Aug-07 22:58
MemberTsvi Girsh13-Aug-07 22:58 
QuestionProblem with Property Grid Pin
rajeevktripathi13-Aug-07 3:33
Memberrajeevktripathi13-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
Memberleppie13-Aug-07 5:13 
QuestionRe: Problem with Property Grid Pin
rajeevktripathi13-Aug-07 19:10
Memberrajeevktripathi13-Aug-07 19:10 
QuestionBasic question about memory allocation Pin
A M SOMAN13-Aug-07 3:24
MemberA M SOMAN13-Aug-07 3:24 
AnswerRe: Basic question about memory allocation Pin
blakey40413-Aug-07 3:26
Memberblakey40413-Aug-07 3:26 
GeneralRe: Basic question about memory allocation Pin
A M SOMAN13-Aug-07 3:36
MemberA M SOMAN13-Aug-07 3:36 
GeneralRe: Basic question about memory allocation Pin
blakey40413-Aug-07 3:39
Memberblakey40413-Aug-07 3:39 
GeneralRe: Basic question about memory allocation Pin
N a v a n e e t h13-Aug-07 3:52
MemberN 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
MemberN 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
MemberJustin 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
MemberN 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
MemberJustin Perez13-Aug-07 3:45 
AnswerRe: How to connect to Remote PC using C# Coding? Pin
Michael Sync13-Aug-07 16:36
MemberMichael Sync13-Aug-07 16:36 
QuestionHow to find the item that selected in ListView ? Pin
Yanshof13-Aug-07 3:09
MemberYanshof13-Aug-07 3:09 
AnswerRe: How to find the item that selected in ListView ? Pin
Justin Perez13-Aug-07 3:12
MemberJustin 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
MemberThaer Hamael13-Aug-07 2:56 
AnswerRe: Instollation Solution Pin
Justin Perez13-Aug-07 3:03
MemberJustin 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.