Solved

How to group properties of a class together???

Posted on 2006-10-31
3
180 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
3 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 300 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

809 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