예제 #1
0
        private void BorrarFilasSeleccionadas(DevExpress.XtraGrid.Views.Grid.GridView view)
        {
            if (view == null || view.SelectedRowsCount == 0)
            {
                return;
            }

            DataRow[] rows = new DataRow[view.SelectedRowsCount];

            for (int i = 0; i < view.SelectedRowsCount; i++)
            {
                rows[i] = view.GetDataRow(view.GetSelectedRows()[i]);
            }

            view.BeginSort();

            try
            {
                foreach (DataRow row in rows)
                {
                    row.Delete();
                }
            }
            finally
            {
                view.EndSort();
            }
        }
예제 #2
0
파일: FrmPosEdit.cs 프로젝트: ryurik/ZOV
 private void DeleteFocusedRows(DevExpress.XtraGrid.Views.Grid.GridView view)
 {
     if (view.RowCount > 0 && view.IsValidRowHandle(view.FocusedRowHandle) && !view.IsNewItemRow(view.FocusedRowHandle))
     {
         view.BeginSort();
         try
         {
             view.DeleteRow(view.FocusedRowHandle);
         }
         catch (Exception)
         {
         }
         view.EndSort();
     }
 }