How to group properties of a class together???

Joined
Jul 6, 2006
Messages
2
Reaction score
0
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

Code:
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 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

Code:
<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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top