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
1
2
3
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
ImageColumn and not serial column
Started by Burhan Cakmak, Jul 01 2009 09:15 PM
1 reply to this topic
#1
Posted 01 July 2009 - 09:15 PM
#2
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:
I hope that this helps
Best regards
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;
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
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.
--
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.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users