× CodeTyphon MS Windows (XP, Vista, Win7, Win8.x and Win10) OS Development, discussions and problems

Question TRxDBGrid

  • Adrijan
  • Topic Author
  • Offline
  • New Member
  • New Member
More
1 month 1 week ago #15491 by Adrijan
TRxDBGrid was created by Adrijan
Hi,

Images in TRxDBGrid Titles just won't show:

     grdData.TitleImageList:=imgDataTypes;
     grdData.Columns[0].Title.ImageIndex:=2; 

 

This code works fine with TDBGrid. The same is in design state too.
I tried but cannot figure this out, although in both examples column titles descend from TGridColumnTitle...?

I'm using CT 7.30 on Windows 10.
Please help.
Attachments:

Please Log in or Create an account to join the conversation.

More
1 month 1 week ago - 1 month 1 week ago #15493 by Matis A.
Replied by Matis A. on topic TRxDBGrid
Please, a sample project with the problem, for LAB testing.

PilotLogic Core Programmer
Last edit: 1 month 1 week ago by Matis A..

Please Log in or Create an account to join the conversation.

  • Adrijan
  • Topic Author
  • Offline
  • New Member
  • New Member
More
1 month 1 week ago #15494 by Adrijan
Replied by Adrijan on topic TRxDBGrid
Thanks for reply, here it is.

 

File Attachment:

File Name: test_grid.zip
File Size:203 KB


 
Attachments:

Please Log in or Create an account to join the conversation.

More
1 month 1 week ago #15496 by Matis A.
Replied by Matis A. on topic TRxDBGrid
Thanks, please give us time to test and report

PilotLogic Core Programmer

Please Log in or Create an account to join the conversation.

More
1 month 1 week ago #15497 by Matis A.
Replied by Matis A. on topic TRxDBGrid
Don't work Sir

PilotLogic Core Programmer

Please Log in or Create an account to join the conversation.

  • Adrijan
  • Topic Author
  • Offline
  • New Member
  • New Member
More
1 month 1 week ago #15498 by Adrijan
Replied by Adrijan on topic TRxDBGrid
The project does not work or cannot figure out why TRxDbgrid refuses to show images in Titles?

Please Log in or Create an account to join the conversation.

More
1 month 1 week ago #15499 by Matis A.
Replied by Matis A. on topic TRxDBGrid
TRxDbgrid refuses to show images
someone must put code to TRxDbgrid

PilotLogic Core Programmer

Please Log in or Create an account to join the conversation.

  • Adrijan
  • Topic Author
  • Offline
  • New Member
  • New Member
More
1 month 6 days ago #15500 by Adrijan
Replied by Adrijan on topic TRxDBGrid
Yes, the code is missing.
Since I use my classes anyway, this is the way I resolved it for my purposes:

type
TLunRxDBGrid = class(TRxDBGrid)
public
    procedure  DrawCell(aCol, aRow: integer; aRect: TRect; aState: TGridDrawState);  override;

procedure TLunRxDBGrid.DrawCell(aCol, aRow: integer; aRect: TRect; aState: TGridDrawState);
var xbitmap:TBitMap;
    xindex:integer;
begin
     if (aRow = 0) and (aCol > 0) and Assigned(TitleImageList) then begin
         inherited DrawCell(aCol, aRow, aRect, aState);
         try
           xbitmap := TBitmap.Create;
           try
              xindex:=Self.Columns[aCol].Title.ImageIndex;
           except
             xindex:=-1;
           end;
           if xindex > -1 then begin
              TitleImageList.GetBitmap(xindex,xbitmap);
              Canvas.Draw(aRect.Left+1,aRect.Top+1,xbitmap);
           end;
         finally
           xbitmap.Free;
         end;
     end else begin
         inherited DrawCell(aCol, aRow, aRect, aState);
     end;
end;

I know this is far from correct and generic solution, but I pasted it here in case anybody needs it as a quick fix.

Sir, thank you for your effort.

 

Please Log in or Create an account to join the conversation.

More
1 month 6 days ago #15509 by Matis A.
Replied by Matis A. on topic TRxDBGrid
Thanks
we will try to put your code to LAB CT

PilotLogic Core Programmer

Please Log in or Create an account to join the conversation.