ChangeReason Enumeration

 

Provides the reason that the original data was restored to a ListObject that is bound to data.

Namespace:   Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)

public enum class ChangeReason

Member nameDescription
DataBoundColumnHeaderIsAutoSet

When the AutoSetDataBoundColumnHeaders property of the ListObject control is set to true, the ListObject control does not allow the user to change the column headers.

ErrorInCommit

A change to data in the ListObject control could not be committed to the data source that the control is bound to.

FixedLengthDataSource

The data source that the ListObject control is bound to does not allow adding or removing rows.

FixedNumberOfColumnsInDataBoundList

The ListObject control does not allow columns to be added or removed after it is bound to data.

Other

The original data was restored because of a reason not specified by any of the other ChangeReason values.

ReadOnlyDataSource

The data source that the ListObject control is bound to is read-only.

When the ListObject is bound to data and the user performs an operation that is not allowed, the ListObject restores itself to its previous state and raises the OriginalDataRestored event. The ChangeReason enumeration provides information about why this restoration occurred.

The following code example creates a DataTable and a ListObject, and binds the ListObject to the DataTable. It then creates an OriginalDataRestored event handler. To test the event, right-click a column letter above the ListObject on sheet 1 and then click Delete in the shortcut menu. The event handler replaces the column and column header data and displays a message indicating what kind of data was restored and the reason that the original data was restored.

This example is for a document-level customization.

No code example is currently available or this language may not be supported.
Return to top
Show: