The event handler receives an argument of type CustomDrawEmptyAreaEventArgs containing data related to this event.
The following
CustomDrawEmptyAreaEventArgs properties provide information specific to this event.
Property |
Description |
Appearance |
Gets the painted element's appearance settings. |
BehindColumn |
Gets the blank column's bounding rectangle. |
Bounds |
Gets the painted element's bounding rectangle. |
Cache |
Gets an object specifying the storage for the most used pens, fonts and brushes. |
EmptyAreaRegion |
Gets the region which is occupied by the Empty Area. |
EmptyRectangles |
Gets the array of rectangles that specify the Empty Area. |
EmptyRows |
Gets the bounding rectangle occupied by the empty rows. |
Graphics |
Gets an object used to paint. |
Handled |
Gets or sets a value specifying whether an event was handled and that the default element painting is therefore not required. |
Info |
|
IsRightToLeft |
Gets a value indicating whether the TreeList's elements are aligned to support locales using right-to-left fonts. |
ObjectArgs |
Gets an object containing information about the painted element. |
Painter |
Gets the painter object that provides the default element's painting mechanism. |
Handle the CustomDrawEmptyArea event to custom paint the control's Empty Area(the area where Tree List nodes are going to be displayed).
See the Custom Draw Scenarios topic for information on using custom draw events.
Important
Never change cell values or modify the control's layout on this event, or any other event designed to tune the control's appearance. Any action that causes a layout update can cause the control to malfunction.

Example
The following code handles the CustomDrawEmptyArea event to manually paint the control's empty area when no nodes are displayed.
The image below shows the result.

C# |
using DevExpress.XtraTreeList;
private void treeList1_CustomDrawEmptyArea(object sender, CustomDrawEmptyAreaEventArgs e) {
if (treeList1.Nodes.Count > 1) return;
string s = "No Records Available";
e.Appearance.FontStyleDelta = FontStyle.Bold;
e.Appearance.FontSizeDelta = 2;
e.Cache.DrawString(s, e.Appearance.Font, e.Cache.GetSolidBrush(Color.Black), e.Bounds);
e.Handled = true;
}
|
VB |
Imports DevExpress.XtraTreeList
Private Sub TreeList1_CustomDrawEmptyArea(sender As Object, e As DevExpress.XtraTreeList.CustomDrawEmptyAreaEventArgs) Handles TreeList1.CustomDrawEmptyArea
If TreeList1.Nodes.Count > 1 Then Return
Dim s As String = "No Records Available"
e.Appearance.FontStyleDelta = FontStyle.Bold
e.Appearance.FontSizeDelta = 2
e.Cache.DrawString(s, e.Appearance.Font, e.Cache.GetSolidBrush(Color.Black), e.Bounds)
e.Handled = True
End Sub
|