Skip to main content

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 to display the Location and Phone field values in preview sections.

The following image shows the results.

Preview - GetPreviewText

using DevExpress.XtraTreeList;

treeList1.OptionsView.ShowPreview = true;

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