public void PDADest() { try { ResultModelOfArrayOfModel_Destinationd4FqxSXX Destination = cs.GetPDADestinationList(mp.Idk__BackingField, true, 0, true, null); if (Destination.Code != 0) { MessageBox.Show(Destination.Message); } else { dataGridView1.AutoGenerateColumns = false; dataGridView1.DataSource = Destination.Data; if (Destination.Data.Count <Model_Destination>() == 0) { btnDelete.Enabled = false; } else { btnDelete.Enabled = true; } } } catch (Exception ex) { MessageBox.Show(ex.Message, "error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }