Protected Sub DataList1_CancelCommand(source As Object, e As DataListCommandEventArgs) _ Handles DataList1.CancelCommand ' Set the DataList's EditItemIndex property to -1 DataList1.EditItemIndex = -1 ' Rebind the data to the DataList DataList1.DataBind() End Sub