BeforeAddDataBoundRowEventHandler Delegate
Represents the method that will handle the BeforeAddDataBoundRow event of a ListObject.
Assembly: Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)
public delegate void BeforeAddDataBoundRowEventHandler( Object^ sender, BeforeAddDataBoundRowEventArgs^ e )
Parameters
- sender
-
Type:
System::Object^
The source of the event.
- e
-
Type:
Microsoft.Office.Tools.Excel::BeforeAddDataBoundRowEventArgs^
A BeforeAddDataBoundRowEventArgs that contains the event data.
When you create a BeforeAddDataBoundRowEventHandler delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, until you remove the delegate.
The following code example creates a DataTable and a ListObject, and binds the ListObject to the DataTable. It then creates a BeforeAddDataBoundRow event handler that cancels the addition of the new row. To test the event, manually add a new row to the ListObject on sheet 1.
This example is for a document-level customization.