windowsforms-devexpress-dot-xtratreelist-dot-treelist-f75f6f47.md
Fires immediately after the Customization Form has been displayed.
Namespace : DevExpress.XtraTreeList
Assembly : DevExpress.XtraTreeList.v25.2.dll
NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.TreeList
[DXCategory("Behavior")]
public event EventHandler ShowCustomizationForm
<DXCategory("Behavior")>
Public Event ShowCustomizationForm As EventHandler
The ShowCustomizationForm event's data class is EventArgs.
Users can invoke the Customization Form via the Runtime Column Customization item of the column headers context menu. Note that this menu is only available when the TreeListOptionsMenu.EnableColumnMenu option is enabled.
You can invoke the Customization Form in code by calling the TreeList.ShowCustomization method.
The ShowCustomizationForm event enables you to perform specific actions each time the Customization Form is invoked either by an end-user or in code. This can be used in the following two cases:
Use the TreeList.HideCustomizationForm event to respond to the closing of the Customization Form.
The following sample code assigns a PopupMenu to the Tree List control’s Customization Form. The menu contains a single item that makes all hidden columns visible.
This example provides handlers for two events:
TreeList.ShowCustomizationForm event handler. It is used to assign an existing PopupMenu to the form.using DevExpress.XtraTreeList.Columns;
private void treeList1_ShowCustomizationForm(object sender, System.EventArgs e) {
barManager1.SetPopupContextMenu(treeList1.CustomizationForm, popupMenu1);
}
private void btnDisplayAll_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) {
treeList1.BeginUpdate();
foreach (TreeListColumn column in treeList1.Columns) {
if (column.VisibleIndex == -1 && column.OptionsColumn.ShowInCustomizationForm)
column.VisibleIndex = treeList1.Columns.Count;
}
treeList1.EndUpdate();
}
Imports DevExpress.XtraTreeList.Columns;
Private Sub TreeList1_ShowCustomizationForm(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles TreeList1.ShowCustomizationForm
barManager1.SetPopupContextMenu(treeList1.CustomizationForm, popupMenu1)
End Sub
Private Sub btnDisplayAll_ItemClick(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MenuItem1.Click
Dim Column As TreeListColumn
TreeList1.BeginUpdate()
For Each Column In TreeList1.Columns
If Column.VisibleIndex = -1 And Column.OptionsColumn.ShowInCustomizationForm Then
Column.VisibleIndex = TreeList1.Columns.Count
End If
Next
TreeList1.EndUpdate()
End Sub
See Also