Пример #1
0
 private void InvokeInicializa()
 {
     if (InvokeRequired)
     {
         InicializaCallback callback = InvokeInicializa;
         Invoke(callback);
     }
     else
     {
         DataFator.Cursor = Cursors.WaitCursor;
         this.PopulaDados();
         DataFator.Cursor = Cursors.Default;
         this.Cursor      = Cursors.Default;
         DataFator.Focus();
     }
 }
Пример #2
0
        private void BtnNew_Click(object sender, EventArgs e)
        {
            try
            {
                row_current = 0;

                this.IsInsert = true;
                this.IsEdit   = true;

                BtnEdit.Enabled   = true;
                BtnNew.Enabled    = false;
                BtnSave.Enabled   = true;
                BtnDelete.Enabled = true;

                DataFator.AllowUserToAddRows = true;

                row_current = DataFator.Rows.Count - 1;

                for (int i = 0; i < 10; i++)
                {
                    DataFator.Rows.Add();
                    DataFator.Rows[i].Cells[0].ReadOnly = false;
                    DataFator.Rows[i].Cells[1].ReadOnly = false;
                    DataFator.Rows[i].Cells[2].ReadOnly = false;
                    DataFator.Rows[i].Cells[3].ReadOnly = false;
                    DataFator.Rows[i].Cells[4].ReadOnly = false;
                    DataFator.Rows[i].Cells[6].ReadOnly = false;
                }

                DataFator.CurrentCell = DataFator.Rows[row_current].Cells[0];
                DataFator.Rows[row_current].Selected      = true;
                DataFator.FirstDisplayedScrollingRowIndex = row_current;
                DataFator.Update();
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show(this, ex.Message, "Erro Fatores Conversão",
                                  MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }