摘要:
1) View.DataController.DataModeController.GridMode = False时 RecIdx := View.Controller.SelectedRecords[i].RecordIndex; ColIdx := View.DataController.GetItemByFieldName(AFieldName).Index; OutputVal := View.DataController.Values[RecIdx, ColIdx]; //RecID := View.DataController.GetRecordId(RecIdx); //Out 阅读全文
摘要:
procedure <Form>.<cxGrid>Enter(Sender: TObject); var View: TcxGridDBTableView; begin View := TcxGridDBTableView((Sender as TcxGrid).FocusedView); if View.DataController.DataSet.IsEmpty then begin View.DataController.DataSet.Append; View.Controller.EditingController.ShowEdit; end; end; 阅读全文
摘要:
//恢复布局 IniFileName := ExtractFilePath(Application.ExeName) + 'Layout\' + Self.Name + '.ini'; if FileExists(IniFileName) then Self.tvResult.RestoreFromIniFile(IniFileName) //从布局文件中恢复 else begin Self.tvResult.BeginUpdate; for i := 0 to Self.tvResult.ItemCount - 1 do Self.tvResult.Items 阅读全文
摘要:
procedure TFormUser.tvUserEditing(Sender: TcxCustomGridTableView; AItem: TcxCustomGridTableItem; var AAllow: Boolean); begin //如果第三列值为True,则第4列不能修改 if (tvUser.Controller.FocusedRecord.Values[2] = True) and (AItem.Index = 4) then AAllow := False else AAllow := True; end; 阅读全文
摘要:
在TableView的DataController->Summary->FooterSummary->OnSummary事件中,输入: procedure TFormExpense.tvExpenseDataControllerSummaryFooterSummaryItemsSummary(ASender: TcxDataSummaryItems; Arguments: xSummaryEventArguments; var OutArguments: TcxSummaryEventOutArguments); begin //得到字段名 TcxDBDataSummaryI 阅读全文
摘要:
其实这个方法就是cxGrid范例中提供的,原范例在CellLevelMultiselectDemo目录下把cxGridView里OptionsView选项中的两项修改成如下OptionsView.Indicator = TrueOptionsView.IndicatorWidth = 40//宽度在customDrawIndicatorCell事件中填写procedure TForm1.cxGrid1BandedTableView1CustomDrawIndicatorCell(Sender: TcxGridTableView; ACanvas: TcxCanvas;AViewInfo: Tc 阅读全文
摘要:
cxGrid1DBTableView1.DataController.Summary.FooterSummaryValues[0]; 阅读全文
摘要:
将属性OptionsBehavior.FocusFirstCellOnNewRecord = True OptionsBehavior.GoToNextCellOnEnter = True OptionsBehavior.FocusCellOnCycle = True 此时除了修改OptionsBehavior中的属性值外,还要修改OptionData.Appending=True, 阅读全文