예제 #1
0
 /// <summary>
 /// DX doesn't support onRowDeleted event, so I have to reduce code redundancy by this way.
 /// </summary>
 /// <returns></returns>
 private async void DeleteSelectedPersonsFromDataGrid()
 {
     try
     {
         using (PersonsReference.PersonsServiceClient client = new PersonsReference.PersonsServiceClient())
         {
             foreach (int rowNr in MainGridView.GetSelectedRows())
             {
                 PersonsReference.Person person = MainGridView.GetRow(rowNr) as PersonsReference.Person;
                 ShowErrorMessage((await client.DeletePersonAsync(person)).Result);
             }
         }
         MainGridView.DeleteSelectedRows();
     }
     catch
     {
         this.ShowErrorMessage(Properties.Resources.OtherErrorMessage);
     }
 }