private void gridView1_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
        {
            try
            {
                SiteDBEntities2 db = new SiteDBEntities2();

                if (!(gridView1.PostEditor() && gridView1.UpdateCurrentRow()))
                {
                    return;
                }

                GridView view = sender as GridView;
                Object   obj  = view.GetRow(view.FocusedRowHandle);

                if (obj == null)
                {
                    return;
                }

                int kayitid = (gridView1.GetFocusedRowCellValue("ID") == DBNull.Value) ? -1 : (int)gridView1.GetFocusedRowCellValue("ID");
                db.UDI_DaireTanimlari(1, kayitid, gridView1.GetFocusedRowCellValue("DaireNo").ToString());

                var list = db.S_Daireler().Where(c => c.IsDeleted == false).ToList();
                dt = DataControls.ListToDt(list);
                gridControl1.DataSource = dt;
            }
            catch (Exception hata)
            {
                throw;
            }
        }
 private void btnSil_ItemClick(object sender, ItemClickEventArgs e)
 {
     try
     {
         if (XtraMessageBox.Show("Kayıdı silmek istediğinizden eminmisiniz?", "Uyarı", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
         {
             SiteDBEntities2 db      = new SiteDBEntities2();
             int             kayitid = (gridView1.GetFocusedRowCellValue("ID") == DBNull.Value) ? -1 : (int)gridView1.GetFocusedRowCellValue("ID");
             db.UDI_DaireTanimlari(2, kayitid, "");
             var list = db.S_Daireler().Where(c => c.IsDeleted == false).ToList();
             dt = DataControls.ListToDt(list);
             gridControl1.DataSource = dt;
         }
     }
     catch (Exception hata)
     {
         throw;
     }
 }