unit uViewDetallesPresupuesto; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData, cxImageComboBox, cxTextEdit, cxSpinEdit, ImgList, PngImageList, uDADataTable, ActnList, ComCtrls, ToolWin, cxGridLevel, cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxClasses, cxControls, cxGridCustomView, cxGrid, cxCheckBox, TB2Item, TBX, TB2Dock, TB2Toolbar, JvExComCtrls, JvToolBar, uViewDetallesFamilias, cxMaskEdit, cxCurrencyEdit; type TfrViewDetallesPresupuesto = class(TfrViewDetallesFamilias) cxGridViewPUNTOS: TcxGridDBColumn; cxGridViewIMPORTEPUNTOS: TcxGridDBColumn; cxStyle_PUNTOS: TcxStyle; procedure cxGridViewEditing(Sender: TcxCustomGridTableView; AItem: TcxCustomGridTableItem; var AAllow: Boolean); procedure cxGridViewIMPORTEPUNTOSStylesGetContentStyle( Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; out AStyle: TcxStyle); procedure cxGridViewVISIBLEStylesGetContentStyle( Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; out AStyle: TcxStyle); procedure cxGridViewVALORADOStylesGetContentStyle( Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; out AStyle: TcxStyle); private { Private declarations } public { Public declarations } end; implementation uses uBizImportesDetalleBase, uViewContenido; {$R *.dfm} procedure TfrViewDetallesPresupuesto.cxGridViewEditing( Sender: TcxCustomGridTableView; AItem: TcxCustomGridTableItem; var AAllow: Boolean); var IndiceCol : Integer; begin IndiceCol := (Sender as TcxGridDBTableView).GetColumnByFieldName(fld_IMPORTEPUNTOS).Index; if AItem.Index = IndiceCol then begin IndiceCol := (Sender as TcxGridDBTableView).GetColumnByFieldName(fld_TIPODETALLE).Index; if (UpperCase(AItem.GridView.Items[IndiceCol].EditValue) = TIPODETALLE_SUBTOTAL) then AAllow := False else AAllow := True end else inherited; end; procedure TfrViewDetallesPresupuesto.cxGridViewIMPORTEPUNTOSStylesGetContentStyle( Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; out AStyle: TcxStyle); var IndiceCol : Integer; ATipo : String; begin if Assigned(ARecord) then begin IndiceCol := (Sender as TcxGridDBTableView).GetColumnByFieldName(fld_TIPODETALLE).Index; ATipo := VarToStr(ARecord.Values[IndiceCol]); if ATipo = TIPODETALLE_CONCEPTO then AStyle := cxStyle_PUNTOS; if ATipo = TIPODETALLE_SUBTOTAL then AStyle := cxStyle_SUBTOTAL; if ATipo = TIPODETALLE_TITULO then AStyle := cxStyle_TITULO; end; end; procedure TfrViewDetallesPresupuesto.cxGridViewVISIBLEStylesGetContentStyle( Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; out AStyle: TcxStyle); var IndiceCol : Integer; ATipo : String; begin if Assigned(ARecord) then begin IndiceCol := (Sender as TcxGridDBTableView).GetColumnByFieldName(fld_TIPODETALLE).Index; ATipo := VarToStr(ARecord.Values[IndiceCol]); if ATipo = TIPODETALLE_SUBTOTAL then AStyle := cxStyle_SUBTOTAL; if ATipo = TIPODETALLE_TITULO then AStyle := cxStyle_TITULO; end; end; procedure TfrViewDetallesPresupuesto.cxGridViewVALORADOStylesGetContentStyle( Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; out AStyle: TcxStyle); var IndiceCol : Integer; ATipo : String; begin if Assigned(ARecord) then begin IndiceCol := (Sender as TcxGridDBTableView).GetColumnByFieldName(fld_TIPODETALLE).Index; ATipo := VarToStr(ARecord.Values[IndiceCol]); if ATipo = TIPODETALLE_SUBTOTAL then AStyle := cxStyle_SUBTOTAL; if ATipo = TIPODETALLE_TITULO then AStyle := cxStyle_TITULO; end; end; end.