public void OnDelete(object sender, Event evt) { Itinerary it = (Itinerary)GetSelectedData(); if (it == null) // impossible { return; } Globals.delete_itinerary(it); Globals.FillItineraryTable(); }