Exemple #1
0
        public virtual void BtnDel_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (FGridStatu == GridStatu.gsBrowse)
            {
                if (GV_Main.RowCount > 0)
                {
                    if (MessageBox.Show("確定要刪除此筆資料?", "詢問", MessageBoxButtons.OKCancel) == DialogResult.OK)
                    {
                        GV_Main.DeleteSelectedRows();
                        GV_Main.RefreshData();
                        DBUpdate(GCNum.GCN_Main);

                        GC_Main.Refresh();
                        FGridStatu = GridStatu.gsBrowse;

                        BtnNew.Enabled       = true;
                        BtnQuery.Enabled     = true;
                        BtnEdit.Enabled      = true;
                        BtnDel.Enabled       = true;
                        BtnFirst.Enabled     = true;
                        BtnPrior.Enabled     = true;
                        BtnNext.Enabled      = true;
                        BtnLast.Enabled      = true;
                        BtnSave.Enabled      = false;
                        BtnCancel.Enabled    = false;
                        btnAutoWidth.Enabled = true;
                    }
                }
            }
        }