Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Collapse]Form Layout Managers
    Side Panel
   [Collapse]Layout Manager
    [Expand]Product Information
    [Expand]Getting Started
    [Expand]Layout Control
    [Expand]Data Layout Control
    [Expand]Layout Item
    [Expand]Layout Groups
    [Expand]Tabbed Group
    [Expand]Other Layout Elements
    [Expand]Customization Capabilities
    [Expand]Size and Alignment
     Flow Layout
     Table Layout
     Focus Management
    [Expand]Appearance and Look and Feel
    [Expand]Miscellaneous
    [Collapse]Examples
      How to: Access an item located at a specific point
      How to: Add new menu item to the Layout Tree View Context Menu
      How to: Create a tabbed group in code
      How to: Create custom customization form
      How to: Create custom 'fixed' item
      How to: Create layout groups and items in code
      How to: Create layout items in code
      How to: Custom align a control within its layout item
      How to: Enable the Auto-Size Feature for a CheckEdit and Align It Horizontally
      How to: Implement custom functionality for layout context menu
      How to: Lock the size of a layout item
      How to: Make a LayoutControl transparent
      How to: Print a LayoutControl and show its print preview
      How to: Provide Size Constraints for Control via IXtraResizable Interface
      How to: Save and restore layout
      How to: Save the layout between application runs
      How to: Specify which properties to display in the Property Grid when selecting layout items
      How to: Update a Layout Item and its Control
    [Expand]Member Tables
   [Expand]Tabbed MDI Manager
    Tab Control
   [Expand]Wizard Control
    Workspace Manager
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

How to: Specify which properties to display in the Property Grid when selecting layout items

The following example shows how to display only specific properties in the Customization Form's Property Grid, when selecting regular layout items (items of the LayoutControlItem type), and sort these properties in alphabetical order.

To control which properties to display in the Property Grid when selecting layout items, a BasePropertyGridObjectWrapper class descendant is created. In the example, the MyLayoutControlItemPropertyWrapper class is created, introducesingthree public properties: Text, TextLocation and TextVisible. This class is associated with layout items of the LayoutControlItem type via the LayoutControl.RegisterCustomPropertyGridWrapper method. As a result, when selecting any LayoutControlItem object at runtime in customization mode, the Property Grid will display only the public properties specified by the MyLayoutControlItemPropertyWrapper class.

Note

When creating a Wrapper object, the Clone method must be overridden. It must return a copy of the current object.

To display properties in the Property Grid in alphabetical order, the LayoutControl.ShowCustomization event is handled. In this event handler, the Property Grid control is accessed and its PropertySort property is set to PropertySort.Alphabetical.

How would you rate this topic?​​​​​​​