procedure TForm1.DBGrid1EditButtonClick(Sender: TObject);

begin

Showmessage(DBGrid1.SelectedField.AsString);

end;

 

procedure TForm1.FormCreate(Sender: TObject);

begin

DBGrid1.DataSource:=DataSource1;

DataSource1.DataSet:=ADOQuery1;

ADOQuery1.ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;'+

          'Data Source=f:\mcmygs.mdb;'+

          'Persist Security Info=False;'+

          'Jet OLEDB:Database Password=123456';

ADOQuery1.SQL.Text:='Select 自编号,合同号,币种,金额,银行 from dzb';

ADOQuery1.Open;

//TColumnButtonStyle = (cbsAuto, cbsEllipsis, cbsNone);

DBGrid1.Columns[1].ButtonStyle:=cbsEllipsis;

end;

posted on 2013-03-28 19:02  del88  阅读(15)  评论(0编辑  收藏  举报