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
  [Collapse]Vertical Grid
   [Expand]Overview
   [Expand]Fundamentals
   [Collapse]Concepts
    [Expand]Layouts
    [Expand]Binding to Data
    [Collapse]Rows
     [Collapse]Row Operations
       Creating a Tree-Like Structure of Rows
       Accessing Rows
       Scrolling and Focusing Rows
       Using the Rows Iterator
       Expanding and Collapsing Rows
      Row Class Structure
      Row Properties
      Category Rows
      Editor Rows
      Multi-Editor Rows
      Fixed Rows
    [Expand]Records
    [Expand]Cells
    [Expand]In-place Editors
     Formatting
    [Expand]Appearances
     Hit Information
    [Expand]Custom Painting
    [Expand]Alpha Blending and Background Images
    [Expand]Customization Form
     Batch Modifications
    [Expand]Drag and Drop
   [Expand]Visual Elements
   [Expand]Design-Time Features
   [Expand]Examples
   [Expand]End-User Capabilities
   [Expand]Member Tables
  [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
  [Expand]Form Layout Managers
  [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]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]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Expanding and Collapsing Rows

Each row in a vertical grid control (VGridControl or PropertyGridControl) can have a number of child rows, so rows can be expanded and collapsed to show or hide their children respectively. This topic describes the means by which they can be collapsed or expanded.

Expanded Collapsing and Expanding Rows

Rows in the vertical grids inherit the ability to contain child rows and to be the children of other rows from their common ancestor - the BaseRow class. Amongst other settings, this class declares the BaseRow.Expanded property which can be used to collapse or expand rows and to determine their current state. To expand a row, you must set its BaseRow.Expanded property to true, setting it to false will collapse the row. The image below shows how to change the expanded state of a row at design time.

To change the expanded state for a specific row at runtime you need to obtain its row object and modify the BaseRow.Expanded property value. Please refer to the Accessing Rows topic for details on how to obtain an object which represents the desired row.

The code line below shows how to collapse the rowMain row.

Note that the BaseRow.Expanded row property value doesn't affect the expanded state of a row's child rows. For instance, expanding a row that has collapsed child rows will not expand its children. So, if you collapse a row, all child rows will retain their expanded state and will appear in these states again when their parents are expanded.

In addition to expanding and collapsing individual rows, the vertical grid enables you to expand a row together with all of its child rows. This can be performed using the VGridControlBase.FullExpandRow method that requires a row as the parameter.

The line of code below demonstrates how to use the VGridControlBase.FullExpandRow method to expand the rowMain row together with all its children.

To expand or collapse all rows, use the VGridControlBase.ExpandAllRows and VGridControlBase.CollapseAllRows methods.

When designing applications using the vertical grids you can expand or collapse rows which satisfy a specific condition. This can be performed by means of the Rows Iterator technology introduced by the vertical grid control. This technology provides an easy way of traversing through control rows and performing operations on them. Please refer to the Using the Rows Iterator topic for more information regarding this.

The following sample code is used to collapse all rows that do not contain the focused row as the child. So as a result only rows that are parents of the focused row are expanded, to implement this the new operation class used by the rows iterator is declared and its instance is passed to the VGridRowsIterator.DoOperation method of the iterator.

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