Solved

How to group properties of a class together???

Posted on 2006-10-31
3
171 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now