ErrorAddDataBoundRowEventArgs Interface
Provides information for the ErrorAddDataBoundRow event.
Assembly: Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)
| Name | Description | |
|---|---|---|
![]() | InnerException | Gets the Exception instance that caused the current exception. |
![]() | Item | Gets the new item that the ListObject attempted to add to the data source. |
![]() | Retry | Gets or sets a value indicating whether the ListObject should attempt to add the item again. |
The ErrorAddDataBoundRow event is raised by the ListObject control if an exception occurs during an attempt to add a new row to the data source bound to the ListObject. The Item property can be used to get the new item that the ListObject tried to add. The InnerException property provides the exception that was thrown, and the Retry property can be used to indicate whether another attempt to add this row should be made.
The following code example creates a DataTable and a ListObject, and binds the ListObject to the DataTable. It then creates an ErrorAddDataBoundRow event handler. To test the event, manually add a new row to the ListObject and enter the last name "Chan" and a first name. The event handler displays a message.
This example is for a document-level customization.
