示例#1
0
 private void PopulaData()
 {
     try {
         this.Cursor = Cursors.WaitCursor;
         DataPais.Rows.Clear();
         paises = paisDAO.FindAll();
         for (int i = 0; i < paises.Count; i++)
         {
             DataPais.Rows.Add();
             DataPais.Rows[i].Cells[0].Value           = paises[i].Land;
             DataPais.Rows[i].Cells[0].ReadOnly        = true;
             DataPais.Rows[i].Cells[0].Style.BackColor = Color.LightSlateGray;
             DataPais.Rows[i].Cells[1].Value           = paises[i].Nome;
             DataPais.Rows[i].Cells[1].ReadOnly        = true;
             DataPais.Rows[i].Cells[1].Style.BackColor = Color.LightGray;
         }
         DataPais.Rows[0].Selected   = true;
         DataPais.AllowUserToAddRows = false;
         this.Cursor = Cursors.Default;
     }
     catch (Exception ex)
     {
         this.Cursor = Cursors.Default;
         MessageBoxEx.Show(this, ex.Message, "Erro Paises",
                           MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }