Solved

How to group properties of a class together???

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

626 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