-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathUCheckBoxGrid_Test.pas
More file actions
74 lines (64 loc) · 1.87 KB
/
UCheckBoxGrid_Test.pas
File metadata and controls
74 lines (64 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
unit UCheckBoxGrid_Test;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Data.DB, Datasnap.DBClient, Vcl.Grids,
Vcl.DBGrids, Ucheckgrid, Vcl.StdCtrls, Vcl.DBCtrls, Vcl.ComCtrls, Vcl.ExtCtrls,
FireDAC.Stan.Intf, FireDAC.Stan.Option, FireDAC.Stan.Error, FireDAC.UI.Intf,
FireDAC.Phys.Intf, FireDAC.Stan.Def, FireDAC.Stan.Pool, FireDAC.Stan.Async,
FireDAC.Phys, FireDAC.Phys.IB, FireDAC.Phys.IBDef, FireDAC.VCLUI.Wait,
FireDAC.Stan.Param, FireDAC.DatS, FireDAC.DApt.Intf, FireDAC.DApt,
FireDAC.Comp.DataSet, FireDAC.Comp.Client, FireDAC.Phys.IBBase,
FireDAC.Comp.UI;
type
TForm185 = class(TForm)
DBGrid1: TDBGrid;
Panel1: TPanel;
FDConnection1: TFDConnection;
FDGUIxWaitCursor1: TFDGUIxWaitCursor;
FDPhysIBDriverLink1: TFDPhysIBDriverLink;
FDTable1: TFDTable;
DataSource1: TDataSource;
Button1: TButton;
Label1: TLabel;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form185: TForm185;
implementation
{$R *.dfm}
procedure TForm185.Button1Click(Sender: TObject);
var
sum: integer;
I: integer;
begin
if DBGrid1.SelectedRows.Count > 0 then
begin
sum := 0;
with DBGrid1.DataSource.DataSet do
begin
DisableControls;
try
for I := 0 to DBGrid1.SelectedRows.Count-1 do
begin
GotoBookmark(DBGrid1.SelectedRows.Items[I]); // i 번째 선택된 레코드로 이동
Sum := Sum + FDTable1.FieldByName('Salary').AsInteger;
end;
finally
EnableControls;
end;
end;
Label1.Caption := FormatFloat('#,##0원',Sum);
end;
end;
procedure TForm185.Button2Click(Sender: TObject);
begin
Dbgrid1.SelectedRows.Clear;
end;
end.