473,624 Members | 2,117 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 23930
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************* *@exisconsultin g.com

"Robert Hooker" <rh*****@rhooke r.com> wrote in message
news:eR******** ******@tk2msftn gp13.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
PropertyDescrip torCollection 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************ **@exisconsulti ng.com> wrote
in message news:eP******** ******@TK2MSFTN GP11.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************* *@exisconsultin g.com

"Robert Hooker" <rh*****@rhooke r.com> wrote in message
news:eR******** ******@tk2msftn gp13.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.mi crosoft.com <Remove word online. from address>

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


--------------------
From: "Robert Hooker" <rh*****@rhooke r.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.publi c.dotnet.framew ork.windowsform s,microsoft.pub lic.dotnet.lang uages.csharp
NNTP-Posting-Host: 12.155.152.130
Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!tk2 msftngp13.phx.g bl
Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1695 14 microsoft.publi c.dotnet.framew ork.windowsform s:48371
X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.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\sortin g, 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*****@rhooke r.com> wrote in message
news:eR******** ******@tk2msftn gp13.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
10617
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 through this array and inserting values into a new array (Array2) only if they don't exist in the second array.
4
2778
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
3847
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 text representation of what I'm talking about FORM Item Number Description Category (text box) (text box) (combo box - 2 columns)
2
2817
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, click an associated button and that criteria becomes part of the where clause of a select statement. The selected criteria is stored on a hidden form and when the user is ready to run their report(s), a button action goes through the hidden form and...
0
952
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 custom color for this text? Thank you, Lance
1
2630
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 help me and give me some tips on how to do it only with additional txt files? Any help is appriciated! Thank you Sincirly, Jernej
0
1155
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 the code or ideas.. Thanks in advance Vanishree KS
4
1613
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 as a number but as a text field regards,
1
1278
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 fields so this causes a problem. Here is an example "fieldone fieldtwo fieldthree fieldfour" "fieldone fieldthree fieldfour" My script would read fieldtwo to be fieldthree instead of blank
0
8238
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8174
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8624
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8336
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8478
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7164
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5565
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4082
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2607
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.