Sort properties inside a category

  • Thread starter Thread starter Polo
  • Start date Start date
P

Polo

Hi All,

I have defined some properties on a object with a category Attribute
How can I use a custom sort inside a category ?

See below

By default :

General information <- Category
Adress
Name
ID
Private Information <- Category
Email
Phone number

I would like :

General information <- Category
ID
Name
Adress
Private Information <- Category
Phone number
Email

Thanks
 
Hi Polo,

Based on my understanding, your 3 property Adress, Name, ID are all
added the attribute Category("General"), so they will appear in the General
category in property grid. So is with Phone number, Email which are
placed in Private category.
But I do not know why you said they original appear as :
Adress
Name
ID

Because so far as I think, .Net will order all the property in the same
category alphabetically. Like this:
Adress
ID
Name

Beside this:
For your requirement, do you want the order of all the property in the same
category determine by yourself?

If I misunderstand you, please feel free to tell me.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
I don't think that is possible...

vJ

Polo said:
In fact, I woul like to have a custom sort in the category

""Jeffrey Tan[MSFT]"" <[email protected]> a écrit dans le message
de news:[email protected]...
Hi Polo,

Based on my understanding, your 3 property Adress, Name, ID are all
added the attribute Category("General"), so they will appear in the General
category in property grid. So is with Phone number, Email which are
placed in Private category.
But I do not know why you said they original appear as :
Adress
Name
ID

Because so far as I think, .Net will order all the property in the same
category alphabetically. Like this:
Adress
ID
Name

Beside this:
For your requirement, do you want the order of all the property in the same
category determine by yourself?

If I misunderstand you, please feel free to tell me.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Hi Polo,

I think may be you can get this done through implement
ICustomTypeDescriptor interface for your component. For its GetProperties()
method, return your wanted property order. And there is a sort method of
PropertyDescriptorCollection, you may adjust the property order through
this method.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Oh Polo,

After some research, I found that this can not be done in VS.net property
grid.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top