// 新增行后,默认首列
procedure TForm1.ADOQuery1AfterInsert(DataSet: TDataSet);
begin
with DBGridEh1 do
begin
SelectedIndex := 0;
end;
end;
// 行选中
DBGridEh_Yingfu_SearchQK.SelectedRows.SetCurrentRowSelected(True);
//选中单元格
DBGridEh1.SelectedField := ADOQuery1.FieldByName('收银简称');
//
with DbgridEh_Xiaoshth_mx.SelectedField do
if DATASET.Active then
else if (FieldName = 'peij_dj') then //焦点停留在单价上
begin
Action_Searchprice.Execute;
end
// 下拉框
with DbgridEh_Xiaoshth_mx, DataSource.DataSet do
begin
SelectedField := FieldByName('cangk_dm');
with dm_main.Query_Cangk do
begin
if active then close;
open;
first;
Columns[SelectedIndex].KeyList.Clear;
Columns[SelectedIndex].picklist.Clear;
while not eof do
begin
Columns[SelectedIndex].KeyList.Add(fieldbyname('cangk_dm').AsString);
Columns[SelectedIndex].PickList.Add(fieldbyname('cangk_mc').AsString);
next;
end;
end;
columns[SelectedIndex].autodropdown := true;
end;
with DbgridEh_Xiaoshth_mx, DataSource.DataSet do
begin
SelectedField := FieldByName('peij_dw');
Columns[SelectedIndex].PickList := ReturnItemString(ITDanw_lc);
columns[SelectedIndex].autodropdown := true;
SelectedField := FieldByName('peij_jk');
with Columns[SelectedIndex].PickList do
begin
Clear;
Add('国产');
ADd('进口');
add('');
end;
Columns[SelectedIndex].AutoDropDown := true;
end;
---------------------
作者:苍穹帝
来源:CSDN
原文:https://blog.csdn.net/gjtao1130/article/details/42120319?utm_source=copy
版权声明:本文为博主原创文章,转载请附上博文链接!