Guest Posted February 26, 2011 Posted February 26, 2011 Message from: "ayweo" ÎÒ²»»áÓ¢ÓºÃÐÄÈË°ïæ·Òëһϰɣ¡Ð»Ð»£¡ Ä¿µÄ£º¸ù¾Ý±íÖÐÌض¨ÁеÄÖµÓÃÑÕÉ«±êʶÌض¨µÄÐС£ ÓÃDemosÖеÄDBLookupÀý×Ó¸ÄÁËÒ»¸ö£¬ÔÚUniDBGridµÄOnDrawColumnCellʼþÖмÓÉÏÈçÏ´úÂ룺 procedure TMainForm.UniDBGrid1DrawColumnCell(Sender: TObject; ACol, ARow: Integer; var Value: string; Column: TUniDBGridColumn; Attribs: TUniCellAttribs); begin if Column.FieldName = 'OrderNo' then if Column.Field.Value < 1010 then Attribs.Color := clRed; end; VCLģʽÏÂÏàÓ¦ËٶȻ¹ÐУ¬µ«ÊÇWEBģʽϾͺÜÔã¸âÁË¡£ Èç¹ûд³ÉÕâÑù¾Í¸üÔã¸âÁË¡£µ«ÊÇ£¬ÎÒÏ£ÍûÄܱêʶÕýÐÐÊý¾ÝµÄ¡£ procedure TMainForm.UniDBGrid1DrawColumnCell(Sender: TObject; ACol, ARow: Integer; var Value: string; Column: TUniDBGridColumn; Attribs: TUniCellAttribs); begin if UniMainModule.ClientDataSet1.FieldByName('OrderNo').Value < 1010 then Attribs.Color := clRed; end; . Quote
Guest Posted February 27, 2011 Author Posted February 27, 2011 Message from: "Farshad Mohajeri" "ayweo" wrote in message = news:2CECpUZ1LHA.2164@anaxagvs227... > = =CE=D2=B2=BB=BB=E1=D3=A2=D3=EF=A3=AC=BA=C3=D0=C4=C8=CB=B0=EF=C3=A6=B7=AD=D2= =EB=D2=BB=CF=C2=B0=C9=A3=A1=D0=BB=D0=BB=A3=A1 >=20 > = =C4=BF=B5=C4=A3=BA=B8=F9=BE=DD=B1=ED=D6=D0=CC=D8=B6=A8=C1=D0=B5=C4=D6=B5=D3= =C3=D1=D5=C9=AB=B1=EA=CA=B6=CC=D8=B6=A8=B5=C4=D0=D0=A1=A3 > = =D3=C3Demos=D6=D0=B5=C4DBLookup=C0=FD=D7=D3=B8=C4=C1=CB=D2=BB=B8=F6=A3=AC= =D4=DAUniDBGrid=B5=C4OnDrawColumnCell=CA=C2=BC=FE=D6=D0=BC=D3=C9=CF=C8=E7= =CF=C2=B4=FA=C2=EB=A3=BA > procedure TMainForm.UniDBGrid1DrawColumnCell(Sender: TObject; ACol, > ARow: Integer; var Value: string; Column: TUniDBGridColumn; > Attribs: TUniCellAttribs); > begin > if Column.FieldName =3D 'OrderNo' then > if Column.Field.Value < 1010 then > Attribs.Color :=3D clRed; > end; > = VCL=C4=A3=CA=BD=CF=C2=CF=E0=D3=A6=CB=D9=B6=C8=BB=B9=D0=D0=A3=AC=B5=AB=CA=C7= WEB=C4=A3=CA=BD=CF=C2=BE=CD=BA=DC=D4=E3=B8=E2=C1=CB=A1=A3 > = =C8=E7=B9=FB=D0=B4=B3=C9=D5=E2=D1=F9=BE=CD=B8=FC=D4=E3=B8=E2=C1=CB=A1=A3=B5= =AB=CA=C7=A3=AC=CE=D2=CF=A3=CD=FB=C4=DC=B1=EA=CA=B6=D5=FD=D0=D0=CA=FD=BE=DD= =B5=C4=A1=A3 > procedure TMainForm.UniDBGrid1DrawColumnCell(Sender: TObject; ACol, > ARow: Integer; var Value: string; Column: TUniDBGridColumn; > Attribs: TUniCellAttribs); > begin > if UniMainModule.ClientDataSet1.FieldByName('OrderNo').Value < 1010 = then > Attribs.Color :=3D clRed; > end;=20 > Google translate says: I'm not English, good-hearted people to help translate yourself! Thank = you! Objective: According to the value of a particular column in the table = identifies the specific use of the color line. Demos in DBLookup example with a change in the UniDBGrid the = OnDrawColumnCell event add the following code: procedure TMainForm.UniDBGrid1DrawColumnCell (Sender: TObject; ACol, ARow: Integer; var Value: string; Column: TUniDBGridColumn; Attribs: TUniCellAttribs); begin if Column.FieldName =3D 'OrderNo' then if Column.Field.Value <1010 then Attribs.Color: =3D clRed; end; VCL mode, the corresponding speed was okay, but the WEB mode is very = bad. If you write something like this even worse. However, I hope to identify = the positive line of data. procedure TMainForm.UniDBGrid1DrawColumnCell (Sender: TObject; ACol, ARow: Integer; var Value: string; Column: TUniDBGridColumn; Attribs: TUniCellAttribs); begin if UniMainModule.ClientDataSet1.FieldByName ('OrderNo'). Value <1010 = then Attribs.Color: =3D clRed; end; My response: Custom cell rendering can reduce performance. You must use it in Paged = mode where number of rows are limited. In my PC which is a low-end dual-core performance is acceptable. What is = your PC configuration? Quote
Guest Posted February 27, 2011 Author Posted February 27, 2011 Message from: "ayweo" "Farshad Mohajeri" =D0=B4=C8=EB=CF=FB=CF=A2 = news:4LSgb0f1LHA.3124@anaxagvs227... "ayweo" wrote in message = news:2CECpUZ1LHA.2164@anaxagvs227... > = =CE=D2=B2=BB=BB=E1=D3=A2=D3=EF=A3=AC=BA=C3=D0=C4=C8=CB=B0=EF=C3=A6=B7=AD=D2= =EB=D2=BB=CF=C2=B0=C9=A3=A1=D0=BB=D0=BB=A3=A1 >=20 > = =C4=BF=B5=C4=A3=BA=B8=F9=BE=DD=B1=ED=D6=D0=CC=D8=B6=A8=C1=D0=B5=C4=D6=B5=D3= =C3=D1=D5=C9=AB=B1=EA=CA=B6=CC=D8=B6=A8=B5=C4=D0=D0=A1=A3 > = =D3=C3Demos=D6=D0=B5=C4DBLookup=C0=FD=D7=D3=B8=C4=C1=CB=D2=BB=B8=F6=A3=AC= =D4=DAUniDBGrid=B5=C4OnDrawColumnCell=CA=C2=BC=FE=D6=D0=BC=D3=C9=CF=C8=E7= =CF=C2=B4=FA=C2=EB=A3=BA > procedure TMainForm.UniDBGrid1DrawColumnCell(Sender: TObject; ACol, > ARow: Integer; var Value: string; Column: TUniDBGridColumn; > Attribs: TUniCellAttribs); > begin > if Column.FieldName =3D 'OrderNo' then > if Column.Field.Value < 1010 then > Attribs.Color :=3D clRed; > end; > = VCL=C4=A3=CA=BD=CF=C2=CF=E0=D3=A6=CB=D9=B6=C8=BB=B9=D0=D0=A3=AC=B5=AB=CA=C7= WEB=C4=A3=CA=BD=CF=C2=BE=CD=BA=DC=D4=E3=B8=E2=C1=CB=A1=A3 > = =C8=E7=B9=FB=D0=B4=B3=C9=D5=E2=D1=F9=BE=CD=B8=FC=D4=E3=B8=E2=C1=CB=A1=A3=B5= =AB=CA=C7=A3=AC=CE=D2=CF=A3=CD=FB=C4=DC=B1=EA=CA=B6=D5=FD=D0=D0=CA=FD=BE=DD= =B5=C4=A1=A3 > procedure TMainForm.UniDBGrid1DrawColumnCell(Sender: TObject; ACol, > ARow: Integer; var Value: string; Column: TUniDBGridColumn; > Attribs: TUniCellAttribs); > begin > if UniMainModule.ClientDataSet1.FieldByName('OrderNo').Value < 1010 = then > Attribs.Color :=3D clRed; > end;=20 > Google translate says: I'm not English, good-hearted people to help translate yourself! Thank = you! Objective: According to the value of a particular column in the table = identifies the specific use of the color line. Demos in DBLookup example with a change in the UniDBGrid the = OnDrawColumnCell event add the following code: procedure TMainForm.UniDBGrid1DrawColumnCell (Sender: TObject; ACol, ARow: Integer; var Value: string; Column: TUniDBGridColumn; Attribs: TUniCellAttribs); begin if Column.FieldName =3D 'OrderNo' then if Column.Field.Value <1010 then Attribs.Color: =3D clRed; end; VCL mode, the corresponding speed was okay, but the WEB mode is very = bad. If you write something like this even worse. However, I hope to identify = the positive line of data. procedure TMainForm.UniDBGrid1DrawColumnCell (Sender: TObject; ACol, ARow: Integer; var Value: string; Column: TUniDBGridColumn; Attribs: TUniCellAttribs); begin if UniMainModule.ClientDataSet1.FieldByName ('OrderNo'). Value <1010 = then Attribs.Color: =3D clRed; end; My response: Custom cell rendering can reduce performance. You must use it in Paged = mode where number of rows are limited. In my PC which is a low-end dual-core performance is acceptable. What is = your PC configuration? CPU:Intel Core Duo E4500 RAM: DDR2 4G OS:Win7 =B4=F2=BF=AA=B4=F8=D5=E2=D1=F9=B5=C4WEB DEMO=D2=AA5=C3=EB=D7=F3=D3=D2 Quote
Guest Posted February 28, 2011 Author Posted February 28, 2011 Message from: "Farshad Mohajeri" "ayweo" wrote in message = news:66Z8ssi1LHA.3124@anaxagvs227... Custom cell rendering can reduce performance. You must use it in Paged = mode where number of rows are limited. In my PC which is a low-end dual-core performance is acceptable. What = is your PC configuration? CPU:Intel Core Duo E4500 RAM: DDR2 4G OS:Win7 =B4=F2=BF=AA=B4=F8=D5=E2=D1=F9=B5=C4WEB DEMO=D2=AA5=C3=EB=D7=F3=D3=D2 If you have lots of columns and rows with colored attributes then it is = possible, but again 5 seconds is too much. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.