Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm Controls / December 2004

Tip: Looking for answers? Try searching our database.

PropertyGrid categories not sorted

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Brett Robichaud - 14 Sep 2004 00:22 GMT
Does anyone know how I can keep the PropertyGrid from sorting the category
names when I set the PropertySort field to Categorized?

I'm not talking about the items within the categories, but the categories
themselves.  I'd like to use the order the categories first appear in the
list of fields.  Can this be done?

-Brett-
"Jeffrey Tan[MSFT]" - 14 Sep 2004 09:53 GMT
Hi Trapulo,

I have reviewed your post, I will reply to you ASAP. Thanks for your
understanding.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Signature

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

"Jeffrey Tan[MSFT]" - 15 Sep 2004 04:23 GMT
Hi Brett,

Sorry for letting you wait for so long time.

I am not very sure of your meaning of " the order the categories first
appear in the list of fields", what is "the list of fields"? Category is
specified through CategoryAttribute, so it will has nothing to do with the
properties order.

PropertyGrid is a highly customized control, and it did not expose the
function for us to specify the category order, it will always show it in
alphabetic order.

Also, can you show me your main concern of this issue? Do you just want  
some properties to be placed in different order?

At last, there is a trick of change the category order using invisible
characters, like this:
private int m_prop1;
private int m_prop2;
private int m_prop3;

[Category("\t\tZ First Category")]
public int Prop1
{
    get
    {
        return m_prop1;
    }
}

[Category("\tT Second Category")]
public int Prop2
{
    get
    {
        return m_prop2;
    }
}

[Category("Third Category")]
public int Prop3
{
    get
    {
        return m_prop3;
    }
}

When you view this component in property browser, you will see "Z First
Category" as the first category, because of the "/t" characters. But this
will not change the entire propertygrid's behavior.

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Signature

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Brett Robichaud - 15 Sep 2004 15:55 GMT
I was in fact just looking for a way to make the categories appear in a
specific order, not alphabetical.  Your idea with the special tab characters
works just fine. Thank you.

-Brett-

> Hi Brett,
>
[quoted text clipped - 58 lines]
> Get Secure! - www.microsoft.com/security
> This posting is provided "as is" with no warranties and confers no rights.
"Jeffrey Tan[MSFT]" - 16 Sep 2004 03:16 GMT
Hi Brett,

I am glad I can help you :-)

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Signature

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Benzi Eilon - 30 Dec 2004 05:03 GMT
Hi Jeffrey,

I just stumbled over this issue and I believe that there are many others out
there who need the same functionality meaning, having the categories ordered
according to the order in the PropertyGrid.SelectedObject (no sorting of
categories).

The workaround suggested in this post is not a real solution. On behalf of
MSDN users I suggest that MS add this functionality in the next version of
the framework.

Is there a chance that it is already added to V2.0?

Please check,

Benzi

> Hi Brett,
>
[quoted text clipped - 9 lines]
> Get Secure! - www.microsoft.com/security
> This posting is provided "as is" with no warranties and confers no rights.
"Jeffrey Tan[MSFT]" - 31 Dec 2004 07:47 GMT
Hi Benzi,

Yes, I see your concern, but just as I original stated, currently, this is
the only workaround for this issue.

I am not sure if Whildbey will finally support this feature, I think you
may download the lastest beta version and test on it. Also, if you feel
this issue is important for your project, you may feedback this issue to:
http://register.microsoft.com/mswish/suggestion.asp

Hope this helps

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Signature

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.