Skybound AutoComplete

AutoCompleteManager.Delete Event

Occurs when the delete key is pressed while an item is selected in the drop-down suggestion window.

[Visual Basic]
Public Event Delete As DeleteEventHandler
[C#]
public event DeleteEventHandler Delete;

Event Data

The event handler receives an argument of type DeleteEventArgs containing data related to this event. The following DeleteEventArgs properties provide information specific to this event.

Property Description
AutoComplete Gets the instance of AutoComplete that raised the event.
ItemIndex Gets the index of the item for which the event was raised.
ItemValue Gets the item object for which the event was raised.
Text Gets the string representation of the item, as it is displayed in the drop-down suggestion window.
VisibleIndex Gets the index of the visible item for which the event was raised.

Remarks

The AutoComplete argument passed to a Delete event handler provides a reference to the instance of AutoComplete that raised the event. The component is designed this way so that design-time support may be provided for the Delete event.

The delete event does not delete an item from the list on its own. It is up to you to delete the actual item from the list.

If the item is part of the Items collection, you can use the DeleteItem method of DeleteEventArgs to remove the item from the collection.

Example

This example handles the Delete event to remove an item from the list when delete is pressed.

[C#]

private void autoCompleteManager1_Delete(
    object sender, Skybound.AutoComplete.DeleteEventArgs e)
{
    e.DeleteItem();
}

[Visual Basic]

Private Sub AutoCompleteManager1_Delete( _
  sender As Object, e As Skybound.AutoComplete.DeleteEventArgs) _
  Handles AutoCompleteManager1.Delete
    
    ' Delete the item from the Items collection
    e.DeleteItem
    
End Sub

See Also

AutoCompleteManager Class | Skybound.AutoComplete Namespace