Skip to main content
A newer version of this page is available. .

Preview Sections

  • 2 minutes to read

Preview sections are non-editable regions that allow nodes to display large memo text or custom data. They are displayed under nodes’ data cells across all columns.

TreeListPreview_1

Contents - Displaying Data from a Single Field

To display preview sections, do the following:

  1. Set the TreeListOptionsView.ShowPreview property to true.
  2. Set the TreeList.PreviewFieldName property to a field that automatically provides data for preview sections.

Custom Contents

Set the TreeListOptionsView.ShowPreview property to true, and then handle one of the following events to provide custom contents for preview sections:

Example

The sample code below handles the TreeList.GetPreviewText event. This is used to display values of the Location and Phone fields within preview sections of nodes.

The image illustrates the result of sample code execution.

Preview - GetPreviewText

using DevExpress.XtraTreeList;

private void treeList1_GetPreviewText(object sender, GetPreviewTextEventArgs e) {
   e.PreviewText = "Office Location: " + e.Node["Location"].ToString() + "; Phone: " + 
     e.Node["Phone"].ToString();
}

Height

Use the following members to specify preview section height:

Appearance

Printing API

See Also