Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to group properties of a class together???

Posted on 2006-10-31
3
Medium Priority
?
190 Views
Last Modified: 2010-05-18
Hi guyz. Thanx for sparing some time looking at my problem.

I'm creating a new custom control by inheriting System.Web.UI.WebControls.GridView

Namespace WebControls
Public Class XGridView
    Inherits System.Web.UI.WebControls.GridView
        Public Property SortAscImageUrl() As String
            Get
                'Some codes here
            End Get

            Set(ByVal value As String)
                'Some codes here
            End Set
        End Property
End Class
End Namespace

I want to place the above property under the group PagerSettings.
(In the Visual Designer IDE where you can drag and drop controls, drag a GridView onto the WebForm. Then view its properties in the Property dockable window. Scroll down to PagerSettings. Notice that PagerSettings can be expanded to display other properties grouped under it. I want to place my property SortAscImageUrl there.)
However, if I code as above, my property won't appear under any 'group property' or whatever you call it. It'll appear at the top most hierarchy together with other properties.

Can somebody show me too how to create a new 'group property' so that I can place all my new custom properties under it and can be accessible from the visual designer.

I have tried something like

<Category("Sorting")> _
    Public Property SortAscImageUrl() As String

but it doesn't work the way I wanted. This method will only assigned the property a category which is only useful when we sort the properties in the property dockable window by category instead of alphabetically. The property will still be 'groupless'.

Thanx in advance.
0
Comment
Question by:cyanidex
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 1200 total points
ID: 17841255
You need to use an ExpandableObjectConverter.

Here is an example of what I mean:

Make properties expandable in the Property Grid with ExpandableObjectConverter
http://www.bluevisionsoftware.com/WebSite/TipsAndTricksDetails.aspx?Name=ExpandableObjectConverter

Bob
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question