tcxgrid

delphi - coloring cxdbgrid field depending on its content

巧了我就是萌 提交于 2019-12-14 02:48:34
问题 I am not exactly sure how to put this. I am coloring cxDB grid field based on the value: procedure TForm1.cxGrid1DBTableView1StylesGetContentStyle( Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; var AStyle: TcxStyle); var AColumn: TcxCustomGridTableItem; begin AColumn := (Sender as TcxGridDBTableView).GetColumnByFieldName('SIFRA'); if VarToStr(ARecord.Values[AColumn.Index]) = '007 01' then AStyle := cxstyle1; end; I would like to change the code

How do I color a cxgrid based on table value?

孤人 提交于 2019-12-12 11:35:41
问题 I would like all rows where in particular field name 'hello' is present to get colored green. I tried this on customdrawcell : if abstable1.fieldbyname('somename').asstring = 'Hello' then cxgrid.canvas.brush.color:=clGreen But it wont work... what am I missing here ? 回答1: Don't try to change canvas colors in the Grid. Rather--and I find this to always be true--change colors in the View 's OnDrawCell handler, as in this example: procedure T_fmTabSnapList.View1CustomDrawCell(Sender:

Loop through records on a cxgrid and update a field/column

ⅰ亾dé卋堺 提交于 2019-12-11 13:58:43
问题 I have a cxGrid where I apply a filter to select certain records. When that is done I want to be able to update a field/column in the grid to mark each record that is to be used for the next operation. I haven't been able to figure this out Maybe I haven't been specific enough when describing my problem. I have the cxGrid where I have applied a filter selecting some records. What I then need to do is to click a columnheader and then have a field called fldselected set to True for these

cxDateNavigator1 set weekend days text color in red

风流意气都作罢 提交于 2019-12-11 04:06:00
问题 In TcxDateNavigator , is it possible to mark the weekend (Saturday, Sunday) with a diffrent text color (red)? TMS has this feature implemented but I can't seem to find that in this DevExpress component. 回答1: As for the cxDateNavigator , you can use its OnCustomDrawDayNumber event handler, for instance, as follows: uses DateUtils, cxDateUtils; procedure TForm60.cxDateNavigator1CustomDrawDayNumber(Sender: TObject; ACanvas: TcxCanvas; AViewInfo: TcxSchedulerDateNavigatorDayNumberViewInfo; var

Drag image change while drag over grid

喜你入骨 提交于 2019-12-10 13:58:22
问题 I'm creating an instance of my custom DragObject on StartDrag: procedure TForm1.GridStartDrag(Sender: TObject; var DragObject: TDragObject); begin DragObject := TMyDragControlObject.Create(Sender as TcxGridSite); end; Lately on another grid on DragOver: procedure TForm1.SecondGridDragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); begin Accept := False; if Source is TMyDragControlObject then with TMyDragControlObject(Source) do // using TcxGrid if

How can create summary footer on runtime?

只谈情不闲聊 提交于 2019-12-08 07:58:05
问题 I use TcxGrid I have create fields on execution time because I have a pivot query and columns are variable I filled my grid like theese codes grdCevapDBTableView2.BeginUpdate; grdCevapDBTableView2.ClearItems; fillGridView(grdCevapDBTableView2,command); grdCevapDBTableView2.DataController.CreateAllItems; grdCevapDBTableView2.EndUpdate; Now I want to get sum values from these columns. How can create summary footer on runtime? 回答1: Say for example you had a field called cost and you wanted to