Click here to Skip to main content
15,914,111 members
Home / Discussions / C#
   

C#

 
Questionstring ctor?? Pin
HahnTech18-Oct-04 12:33
HahnTech18-Oct-04 12:33 
AnswerRe: string ctor?? Pin
Nick Parker18-Oct-04 15:29
protectorNick Parker18-Oct-04 15:29 
GeneralRe: string ctor?? Pin
HahnTech18-Oct-04 16:28
HahnTech18-Oct-04 16:28 
GeneralRe: string ctor?? Pin
Nick Parker18-Oct-04 18:08
protectorNick Parker18-Oct-04 18:08 
Questionhow to make list in property grid? Pin
AlanJones18-Oct-04 11:10
AlanJones18-Oct-04 11:10 
AnswerRe: how to make list in property grid? Pin
Heath Stewart18-Oct-04 11:46
protectorHeath Stewart18-Oct-04 11:46 
GeneralRe: how to make list in property grid? Pin
AlanJones19-Oct-04 10:01
AlanJones19-Oct-04 10:01 
GeneralRe: how to make list in property grid? Pin
Heath Stewart19-Oct-04 11:07
protectorHeath Stewart19-Oct-04 11:07 
Notice how AppropriateMethod was italicized/emphasized? That means it's not actually what you look up. It would've been logical for you to lookup the TypeDescriptor class even if I did mispell a method or property name and look at it's class documentation. For example, look up TypeDescriptor in the .NET Framework SDK documentation and you'll see the GetProperties overloaded methods.

When you implement the ICustomTypeDescriptor you simply define the two overloaded GetProperties methods as you would with any other interface members. If you're confused about how to implement interfaces, then I suggest you first read the C# Language Specification[^], specifically about Interfaces[^].

For example:
public class MyClass : ICustomTypeDescriptor
{
  // Below is one method defined by ICustomTypeDescriptor that you must implement.
  // Since default functionality would suffice, you use TypeDescriptor.
  public TypeConverter GetConverter()
  {
    return TypeDescriptor.GetConverter(this, true);
  }
 
  // Implement other methods defined by the ICustomTypeDescriptor interface...
 
  public PropertyDescriptorCollection GetProperties()
  {
    return GetProperties(null);
  }
  public PropertyDescriptorCollection GetProperties(Attribute[] filter)
  {
    // Instantiate separate instances of your custom PropertyDescriptor
    // and add to a new PropertyDescriptorCollection that you return when done.
  }
}


This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Sustained Engineering
Microsoft

[My Articles] [My Blog]
GeneralRe: how to make list in property grid? Pin
AlanJones23-Oct-04 13:00
AlanJones23-Oct-04 13:00 
GeneralUsing SignatureCapturing in PocketPc Pin
mathon18-Oct-04 10:26
mathon18-Oct-04 10:26 
GeneralRe: Using SignatureCapturing in PocketPc Pin
Nick Parker18-Oct-04 15:37
protectorNick Parker18-Oct-04 15:37 
GeneralDataGrid Set Column Width Pin
mfcuser18-Oct-04 10:03
mfcuser18-Oct-04 10:03 
GeneralRe: DataGrid Set Column Width Pin
Heath Stewart18-Oct-04 11:53
protectorHeath Stewart18-Oct-04 11:53 
GeneralRe: DataGrid Set Column Width Pin
mfcuser19-Oct-04 8:03
mfcuser19-Oct-04 8:03 
GeneralRe: DataGrid Set Column Width Pin
Heath Stewart19-Oct-04 12:44
protectorHeath Stewart19-Oct-04 12:44 
GeneralText on Image control Pin
JAntonaccio18-Oct-04 9:31
JAntonaccio18-Oct-04 9:31 
GeneralRe: Text on Image control Pin
Heath Stewart18-Oct-04 11:50
protectorHeath Stewart18-Oct-04 11:50 
GeneralNtier app Pin
StephenMcAllister18-Oct-04 7:55
StephenMcAllister18-Oct-04 7:55 
GeneralRe: Ntier app Pin
Christian Graus18-Oct-04 10:08
protectorChristian Graus18-Oct-04 10:08 
GeneralRe: Ntier app Pin
Colin Angus Mackay18-Oct-04 11:46
Colin Angus Mackay18-Oct-04 11:46 
GeneralRe: Ntier app Pin
StephenMcAllister18-Oct-04 16:28
StephenMcAllister18-Oct-04 16:28 
GeneralRe: Ntier app Pin
Salil Khedkar19-Oct-04 22:40
Salil Khedkar19-Oct-04 22:40 
GeneralRe: Ntier app Pin
Carl Mercier21-Oct-04 18:50
Carl Mercier21-Oct-04 18:50 
GeneralRe: Ntier app Pin
StephenMcAllister23-Oct-04 7:53
StephenMcAllister23-Oct-04 7:53 
GeneralAdjusting the columns on the datagrid Pin
steve_rm18-Oct-04 5:54
steve_rm18-Oct-04 5:54 

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.