Jump to content


Photo

ImageColumn and not serial column


  • Please log in to reply
1 reply to this topic

#1 Burhan Cakmak

Burhan Cakmak
  • Members
  • 24 posts

Posted 01 July 2009 - 09:15 PM

Hi Boki,

I have Column CardType, it is column not serial value,

Example
Code decs CardType
M-102 Ucsan m-102 mali 156
M-122 Ucsan m-122 mali 107
M-131 Ucsan m-131 mali 146
M-125 Ucsan m-125 mali 0




i am carttype value in (0,107,146,156) i am carttype value not serial value

i am imagelist 4 picture

0 mellow.gif
1 blink.gif
2 laugh.gif
3 ohmy.gif

what showing if cartype = 0 showimage 0, else carttpye = 107 showimage 1, else carttype = 146 showw image 2, carttype 156 show image 3

sorry bad english

thanks ?


Burhan



#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 01 July 2009 - 10:18 PM

Hello Burhan,

1) You need a NxImageColumn and set Images to desired ImageList
2) Set DisplayOptions of Column to doCustom
3) Add next code into OnCustomDrawCell:

CODE
procedure TForm1.NextGrid1CustomDrawCell(Sender: TObject; ACol,
  ARow: Integer; CellRect: TRect; CellState: TCellState);
begin
  if NextGrid1.Cell[ACol, ARow].AsInteger = 0 then
  begin
    NextGrid1.Columns[ACol].Display.AsInteger := 0;
    NextGrid1.Columns[ACol].Display.Paint;
  end;

  if NextGrid1.Cell[ACol, ARow].AsInteger = 107 then
  begin
    NextGrid1.Columns[ACol].Display.AsInteger := 1;
    NextGrid1.Columns[ACol].Display.Paint;
  end;

  if NextGrid1.Cell[ACol, ARow].AsInteger = 146 then
  begin
    NextGrid1.Columns[ACol].Display.AsInteger := 2;
    NextGrid1.Columns[ACol].Display.Paint;
  end;
end;


I hope that this helps smile.gif

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users