private void RemoverRenglonDelGrid(DevExpress.XtraGrid.GridControl Grid, DevExpress.XtraGrid.Views.Grid.GridView GV)
        {
            var lstDoctosPV = (List<DoctosPV>)(Grid.DataSource);

            if (lstDoctosPV.Count > 0)
            {
                int i = GV.GetSelectedRows()[0];
                DoctosPV retiro = (DoctosPV)GV.GetRow(i);

                lstDoctosPV.Remove(retiro);

                Grid.DataSource = lstDoctosPV;
                GV.RefreshData();
            }
        }
示例#2
0
        public void ModifyGridViewInstance(DevExpress.XtraGrid.Views.Grid.GridView masterGridView, int rowHandle, int relationIndex, IModelListView masterModelListView, List<MasterDetailRuleInfo> masterDetailRules) {
            var modelDetailRelationCalculator = new ModelDetailRelationCalculator(masterModelListView, masterGridView, masterDetailRules);
            bool isRelationSet = modelDetailRelationCalculator.IsRelationSet(rowHandle, relationIndex);
            if (isRelationSet) {
                IModelListView childModelListView = modelDetailRelationCalculator.GetChildModelListView(rowHandle, relationIndex);
                Window window = _xafApplication.CreateWindow(TemplateContext.View, null, true, false);
                ListView listView = GetListView(modelDetailRelationCalculator, rowHandle, relationIndex, childModelListView);
                var detailXafGridView = (DevExpress.XtraGrid.Views.Grid.GridView)masterGridView.GetDetailView(rowHandle, relationIndex);
                ((IColumnViewEditor)listView.Editor).CustomGridViewCreate +=
                    (o, eventArgs) => {
                        ((WinColumnsListEditor)o).DataSource = detailXafGridView.DataSource;
                        eventArgs.Handled = true;
                        eventArgs.GridView = detailXafGridView;
                        eventArgs.GridControl.DataSource = detailXafGridView.DataSource;
                    };

                EventHandler[] listViewOnControlsCreated = { null };
                listViewOnControlsCreated[0] = (sender, args) => {
                    ((IMasterDetailColumnView)detailXafGridView).MasterFrame = ((IMasterDetailColumnView)masterGridView).MasterFrame ?? _masterFrame;
                    ((IMasterDetailColumnView)detailXafGridView).Window = window;
                    detailXafGridView.GridControl = masterGridView.GridControl;
                    listView.ControlsCreated -= listViewOnControlsCreated[0];
                };
                listView.ControlsCreated += listViewOnControlsCreated[0];
                ((PropertyCollectionSource)listView.CollectionSource).MasterObject = masterGridView.GetRow(rowHandle);
                window.SetView(listView);
            }
        }
示例#3
0
 object GetFocusedRowObject(DevExpress.ExpressApp.Win.Editors.XafGridView view) {
     if (view is XpandXafGridView && ((XpandXafGridView)view).Window == null)
         return XtraGridUtils.GetFocusedRowObject(_collectionSourceBase, view);
     int rowHandle = view.FocusedRowHandle;
     if (!((!view.IsDataRow(rowHandle) && !view.IsNewItemRow(rowHandle))))
         return view.GetRow(rowHandle);
     return XtraGridUtils.GetFocusedRowObject(_collectionSourceBase, view);
 }
 private clsTipoCombustible getRow(DevExpress.XtraGrid.Views.Grid.GridView view)
 {
     try
     {
         return (clsTipoCombustible)view.GetRow(view.FocusedRowHandle);
     }
     catch (Exception)
     {
         return null;
     }
 }
 private clsIngresoEgresoCAB getRow(DevExpress.XtraGrid.Views.Grid.GridView view)
 {
     try
     {
         return (clsIngresoEgresoCAB )view.GetRow(view.FocusedRowHandle);
     }
     catch (Exception)
     {
         return null;
     }
 }
 private clsOrdenCompraDET getRow(DevExpress.XtraGrid.Views.Grid.GridView view)
 {
     try
     {
         return (clsOrdenCompraDET)view.GetRow(view.FocusedRowHandle);
     }
     catch (Exception)
     {
         return null;
     }
 }
        private clsActivoFijo getRow(DevExpress.XtraGrid.Views.Grid.GridView view)
        {
            try
            {
                return (clsActivoFijo)view.GetRow(view.FocusedRowHandle);
            }
            catch (Exception)
            {

                return null;
            }
        }
        private clsRevalorizacion getRow(DevExpress.XtraGrid.Views.Grid.GridView view)
        {
            try
            {
                return (clsRevalorizacion)view.GetRow(view.FocusedRowHandle);
            }
            catch (Exception)
            {

                return null;
            }
        }
示例#9
0
 public static void addChildRow(DevExpress.XtraGrid.Views.Grid.GridView view, int indexRow)
 {
     int newRowHandle = view.FocusedRowHandle;
     object newRow = view.GetRow(newRowHandle);
     if (view.GroupedColumns.Count > 0)
     {
         for (int i = 0; i < view.GroupedColumns.Count; i++)
         {
             view.SetRowCellValue(newRowHandle, view.GroupedColumns[i], indexRow);
         }
     }
 }
        //
        private clsEmpresaServicio GetSelectedRow(DevExpress.XtraGrid.Views.Grid.GridView view)
        {
            try
            {
            return (clsEmpresaServicio )view.GetRow(view.FocusedRowHandle);
            }
            catch (Exception ex)
            {

            return null;
            }
        }
        private void RemoverRenglonDelGrid(DevExpress.XtraGrid.GridControl Grid, DevExpress.XtraGrid.Views.Grid.GridView GV)
        {
            var lstRegistros = (List<ChequeTransferencia>)(Grid.DataSource);

            if (lstRegistros.Count > 0)
            {
                int i = GV.GetSelectedRows()[0];
                ChequeTransferencia registro = (ChequeTransferencia)GV.GetRow(i);

                lstRegistros.Remove(registro);

                Grid.DataSource = lstRegistros;
                GV.RefreshData();
            }
        }
 private clsUnidadMedida getRow(DevExpress.XtraGrid.Views.Grid.GridView view)
 {
     try
     {
         return (clsUnidadMedida)view.GetRow(view.FocusedRowHandle);
     }
     catch (Exception)
     {
         return null;
     }
 }
 private clsCuenta GetSelectedRowCmbCuenta(DevExpress.XtraGrid.Views.Grid.GridView view)
 {
     try
     {
         return (clsCuenta)view.GetRow(view.FocusedRowHandle);
     }
     catch (Exception ex)
     {
         Console.WriteLine("Error: "+ex);
         return null;
     }
 }
示例#14
0
 public static void returnRowUpdate(DevExpress.XtraGrid.Views.Grid.GridView view, object row)
 {
     for (int n = 0; n < view.DataRowCount; n++)
     {
         if (view.GetRow(n).Equals(row))
         {
             view.FocusedRowHandle = n;
             break;
         }
     }
 }