Skip to content

PdfVisualOutlineItemDeleteEventArgs.AllowDelete Property

Gets or sets a value indicating whether the outline item should be deleted or not.

C#
public bool AllowDelete { get; set; }

Property Value

Boolean

True if the outline item should be deleted. Default is false.

Remarks

This property 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;
}