Bonsoir à tous
j' ai un string[] tableau et j'ai une classe qui s'appelle DynamicProperty et qui hérite de property descriptor je veux bien que lorsque j'appelle DynamicProperty à partir de propertyGrid elle m'affiche une liste déroulante (le contenu du tableau) voici le code de ma classe Dynamic Property
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
 
public class DynamicProperty : PropertyDescriptor
    {
 
        //  private propEditor;
        private string propName;
        private object propValue;
        private string propDescription;
        private string propCategory;
        private Type propType;
        private bool isReadOnly;
        private bool isExpandable;
        //    private string      folder = "";
        public DynamicProperty(string pName, object pValue, string pDesc, string pCat, Type pType, bool readOnly, bool expandable)
            : base(pName, new Attribute[] { })
        {
            // isBrowsable     = browsable;
            propName = pName;
            propValue = pValue;
            propDescription = pDesc;
            propCategory = pCat;
            propType = pType;
            isReadOnly = readOnly;
            isExpandable = expandable;
        }
 
 
 
        public override System.Type ComponentType
        {
            get
            {
                return null;
            }
        }
 
        public override string Category
        {
            get
            {
                return propCategory;
            }
        }
 
        public override bool IsReadOnly
        {
            get
            {
                return isReadOnly;
            }
        }
 
        /* public override bool IsBrowsable 
         {
             get
             {
                 return isBrowsable;					
             }
         }*/
 
        public override System.Type PropertyType
        {
            get
            {
                return propType;
            }
        }
 
        public override bool CanResetValue(object component)
        {
            return true;
        }
 
 
        public override object GetValue(object component)
        {
            return propValue;
        }
 
        public override void SetValue(object component, object value)
        {
            propValue = value;
        }
 
        public override void ResetValue(object component)
        {
            propValue = null;
        }
 
        public override bool ShouldSerializeValue(object component)
        {
            return false;
        }
 
        public override string Description
        {
            get
            {
                return propDescription;
            }
        }
Merci d'avance pour l'aide