Home > Back-end >  Cxgrid how to implement and put inside a cell images and text.
Cxgrid how to implement and put inside a cell images and text.

Time:10-13

1. Within a cell, for example, in the above picture, the below is the picture, the most important thing is, at the same time can automatically adjust the height of the cell, how to implement, please expert help,

CodePudding user response:

Shows two elements in a cell, only the painted

Can automatically adapt to debug, in the event of an OnGetCellHeight calculate itself

CodePudding user response:

How seemingly cb I've seen a similar post

Draw lines below the picture, and then put the pictures in the cell, adaptive height according to the LS said

CodePudding user response:

Cell height can automatically adjust set
Tvcxgrd1DBTableView1. OptionsView. CellAutoHeight:=True
Picture words set cxgrdbclmntvcxgrd1DBTableView1. The Properties of Properties for the Image
Show your picture to text

CodePudding user response:

reference 1st floor ysai response:
shows two elements in a cell, only the painted

Can automatically adapt to debugging, in the event of an OnGetCellHeight their computing


Want to know the method of painting outside, because the individual drawing text also hope that it will receive the click event, such as the painting is very bothersome, want to know is there any easier way, feel so powerful component should have a more simple operation, rather than on the picture, all

refer to the second floor sololie response:
how seemingly cb I've seen a similar post
Draw lines below the picture, and then put the pictures in the cell, the adaptive height according to the LS said


Cb with fewer people, so the two sections is asking

CodePudding user response:

Do you have any familiar devexpress cxgrid, to guide,

CodePudding user response:

 
Procedure TForm1. TvGrid1DBTableView1CustomDrawCell (
Sender: TcxCustomGridTableView; ACanvas: TcxCanvas;
AViewInfo: TcxGridTableDataCellViewInfo; Var ADone: Boolean);
Var
AEditValue: Variant;
APicture: TPicture;
FBounds: TRect;
The begin
CxgrdbclmnGrid1DBTableView1IconImage. Options. Focusing:=False;//points up unchanged icon
If AViewInfo. Item & lt;> CxgrdbclmnGrid1DBTableView1IconImage then
The begin
The Exit;
The end;
AEditValue:=AViewInfo. GridRecord. Values [cxgrdbclmnGrid1DBTableView1IconImage. Index];
If VarIsStr (AEditValue) or VarIsArray (AEditValue) then
The begin
APicture:=TPicture. Create;
Try
LoadPicture (APicture,
TcxImageProperties (cxgrdbclmnGrid1DBTableView1IconImage Properties). GraphicClass, AEditValue);
APicture. Bitmap. Canvas. Brush. Style:=bsClear;
APicture. Bitmap. Canvas. TextOut (10, 40, AViewInfo. GridRecord. Values [cxgrdbclmnGrid1DBTableView1CName. Index]);//the position of the text display themselves according to the need to adjust the
FBounds:=AViewInfo. Bounds;
ACanvas. FillRect (FBounds);
ACanvas. DrawComplexFrame (FBounds clBtnHighlight, clBtnShadow, [bBottom bLeft, bRight], 1);
InflateRect (FBounds, 1, 1);
ACanvas. The Font. Color:=clBlack;
ACanvas. Brush. Style:=bsClear;
ACanvas. DrawGlyph (FBounds FBounds. Left, Top, APicture. Bitmap);
The finally
APicture. Free;
The end;
The end;
ADone:=True;
The end;
  • Related