473,385 Members | 1,782 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Q: Ordering/Sorting [Category] text in a PropertyGrid

Hi all,

I'm looking for a way to sort/order the Category text items in a property
grid. The grids sort the categories by alpha when the catergories are
displayed.
Does anyone at Microsoft (or anywhere else) no of a way that we can override
that sort/order for the category text?

[ We have implemented a fair amount of code to sort/order individual items
in a property grid the way we want them, but haven't found any at all yet to
do the same for Category text...]

Rob.
Nov 13 '05 #1
4 23851
Robert,

I don't believe there is a way to do this. The only thing that I could
find that indicates you might be able to do this is the PropertySort
property. If you set it to none, it says that the properties are displayed
in the order that they are received from the type descriptor. You might be
able to create a proxy type descriptor between your object and the
propertygrid, which would then return not only the properties in the correct
order, but the properties with the categories in the order that you want
them in.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"Robert Hooker" <rh*****@rhooker.com> wrote in message
news:eR**************@tk2msftngp13.phx.gbl...
Hi all,

I'm looking for a way to sort/order the Category text items in a property
grid. The grids sort the categories by alpha when the catergories are
displayed.
Does anyone at Microsoft (or anywhere else) no of a way that we can override that sort/order for the category text?

[ We have implemented a fair amount of code to sort/order individual items
in a property grid the way we want them, but haven't found any at all yet to do the same for Category text...]

Rob.

Nov 13 '05 #2
We've tried this - unfortunately it doesn't work. When we return the
PropertyDescriptorCollection collection, it is correctly sorted the way we
want it (categories and all), but the propertygrid simply ignores that order
for the category texts. It *does* respect the order for individual
properties within each category though...
"Nicholas Paldino [.NET/C# MVP]" <ni**************@exisconsulting.com> wrote
in message news:eP**************@TK2MSFTNGP11.phx.gbl...
Robert,

I don't believe there is a way to do this. The only thing that I could find that indicates you might be able to do this is the PropertySort
property. If you set it to none, it says that the properties are displayed in the order that they are received from the type descriptor. You might be able to create a proxy type descriptor between your object and the
propertygrid, which would then return not only the properties in the correct order, but the properties with the categories in the order that you want
them in.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"Robert Hooker" <rh*****@rhooker.com> wrote in message
news:eR**************@tk2msftngp13.phx.gbl...
Hi all,

I'm looking for a way to sort/order the Category text items in a property grid. The grids sort the categories by alpha when the catergories are
displayed.
Does anyone at Microsoft (or anywhere else) no of a way that we can override
that sort/order for the category text?

[ We have implemented a fair amount of code to sort/order individual items in a property grid the way we want them, but haven't found any at all

yet to
do the same for Category text...]

Rob.


Nov 13 '05 #3
There is no Documented or supported way to do it and nothing is exposed to allow it... I suppose its possible to 'hack' something but I haven't seen anything to indicate anyone
has.

Want to know more? Check out the MSDN Library at http://msdn.microsoft.com or the Microsoft Knowledge Base at http://support.microsoft.com

Scot Rose, MCSD
Microsoft Visual Basic Developer Support
Email : sc***@online.microsoft.com <Remove word online. from address>

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


--------------------
From: "Robert Hooker" <rh*****@rhooker.com>
Subject: Q: Ordering/Sorting [Category] text in a PropertyGrid
Date: Wed, 16 Jul 2003 08:04:04 -0600
Lines: 15
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <eR**************@tk2msftngp13.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.windowsforms,mic rosoft.public.dotnet.languages.csharp
NNTP-Posting-Host: 12.155.152.130
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:169514 microsoft.public.dotnet.framework.windowsforms:483 71
X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

Hi all,

I'm looking for a way to sort/order the Category text items in a property
grid. The grids sort the categories by alpha when the catergories are
displayed.
Does anyone at Microsoft (or anywhere else) no of a way that we can override
that sort/order for the category text?

[ We have implemented a fair amount of code to sort/order individual items
in a property grid the way we want them, but haven't found any at all yet to
do the same for Category text...]

Rob.

Nov 13 '05 #4
Using "non-printable' characters works a treat.
For everyone else struggling with category ordering\sorting, to achieve
this:

+Z First Category
+ some props
+T Second Category
+ other props
+ A third category
+ more props

You can do this:
[Category("\t\tZ First Category]
[Category("\tT First Category]
[Category("A third Category]

It seems the PropetyGrid includes the "tabs" for the purposes of sorting,
but excludes them when it actually renders the text in the cell.

Rob.
"Robert Hooker" <rh*****@rhooker.com> wrote in message
news:eR**************@tk2msftngp13.phx.gbl...
Hi all,

I'm looking for a way to sort/order the Category text items in a property
grid. The grids sort the categories by alpha when the catergories are
displayed.
Does anyone at Microsoft (or anywhere else) no of a way that we can override that sort/order for the category text?

[ We have implemented a fair amount of code to sort/order individual items
in a property grid the way we want them, but haven't found any at all yet to do the same for Category text...]

Rob.

Nov 15 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: David Gray | last post by:
Greetings all, I need to sort an array containing text only values and remove duplicates at the same time. I was thinking of... 1. Loading all values into one array (Array1) 2. Read...
4
by: Chris Mayers | last post by:
Hi, I'm trying to sort a DataGrid (dotNet Windows Forms). Trouble is, the column I'm trying to sort on contains part numbers of the form xxx-yyy where xxx - Part Type yyy - Part Size.
2
by: Todd | last post by:
Hi. I want to sort the records on my form (using either a continuous form or a datasheet) by the unbound "description" column in a combo box on the form (or in the datasheet.) Here's a rough...
2
by: Tim Marshall | last post by:
Access 2003. The situation is this: I have a "criteria selection form" in which there are a many different criteria, mostly displayed as combo and text boxes in which a user can enter stuff,...
0
by: ljlevend | last post by:
I've noticed that PropertyGrids use a grayed-out color for Category text (i.e., the color of text for GridItems that are defined by System.ComponentModel.Category). Is there any way to use a...
1
by: gretzky56 | last post by:
I have a task where I need to sort the data in a txt file(name, last name and age) by the last name. And well this causes a little problem for me. A possible way is to use arrays, but can someone...
0
by: vanishreeks | last post by:
I'm looking for a way to sort/order the Category text items in a property grid. The grids sort the categories by alpha when the catergories are displayed. If anyone has done this please share...
4
by: TSGB | last post by:
Hi I have a problem if one of my fields I chamge it to a text field.( I need to add some text on it) on an ascending ordered report it orders 10 then 100 then 5. How can I order properly my field not...
1
by: just1812 | last post by:
I'm trying to pick off fileds from a line to insert them into a database. The problem that I'm having is that there is no delemiters between columns or set amount of spaces. Some columns have blank...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.