Skip to content

PdfDocumentOutlineView.BeforeOutlineItemDelete Event

Occurs before an outline item is deleted using the DEL key or the default content menu.

C#
public EventHandler<PdfVisualOutlineItemDeleteEventArgs> BeforeOutlineItemDelete;

Event Type

EventHandler<PdfVisualOutlineItemDeleteEventArgs>

Remarks

This event enables the application logic to decide when the outline item should be deleted.

Example

The code below shows how to ask for user confirmation before deleting an outline item.

C#
1
2
3
4
private void documentOutlineView_BeforeOutlineItemDelete(object sender, PdfVisualOutlineItemDeleteEventArgs e)
{
    e.AllowDelete = MessageBox.Show($"Are you sure you want to delete the outline item '{e.VisualOutlineItem.Title}'?", "PDF Viewer Demo", MessageBoxButtons.YesNo) == DialogResult.Yes;
}