ShowMessage(DBGrid1.DataSource.DataSet.FieldByName('field_01').AsString);
or
ShowMessage(DBGrid1.DataSource.DataSet.Fields[0].AsString);上面可以得到当前选中的数据!
怎么可以得到多选的那??
or
ShowMessage(DBGrid1.DataSource.DataSet.Fields[0].AsString);上面可以得到当前选中的数据!
怎么可以得到多选的那??
解决方案 »
- 这个存储过程怎么没有接收到返回值?
- 哪位好心人帮忙看看我的代码哪里写错了,急啊
- 我想美化界面 我想用椭圆形按扭
- 如何真正的在内存中直接运行可执行文件?
- 关于 TdxDBGrid 组件的问题。让在dxDBGrid1显示的纪录中符合条件的纪录以自己指定的字体颜色来显示。**一个实力分水岭的问题,数风流人物
- 数据导出到EXCEL,如何在DELPHI中控制EXCELR的格式。(高手请进)急急急!!!
- 如何设置主从关系,在线等…
- http://www.csdn.net/develop/article/16/16220.shtm
- 请问各位:调用CMD后如何在delphi程序中关闭呢?(分用完了,不好意思,再补上)
- 各位帮帮忙,怎么比较数据库中两个表的差异??
- 请问怎样读取及修改本机的ip地址、子网掩码、网关、DNS等信息(200分,不够再加)
- 急问:delphi 中如何实现类似于java 中的包可见性?? C# 和 C++呢?? 谢~!!
begin
if not Active then Abort;
DisableControls;
try
First;
while not EOF do
begin
DBGrid.SelectedRows.CurrentRowSelected:=True;
Next;
end;
finally
EnableControls;
end;
end;
begin
if not Active then Abort;
DisableControls;
try
First;
while not EOF do
begin
if DBGrid.SelectedRows.CurrentRowSelected then
begin
\\do you want
end;
Next;
end;
finally
EnableControls;
end;
end;
temp:book;
begin
for i:=0 to dbgrid.selecterows.count-1 do begin
temp:=dbgrid.selectrows.items[i];
table1.goto(temp);
for j:=0 to table.fieldcount-1 do
保存当前记录
table1.freebook(temp);
end;
即可处理
BookMark 是 DataSet的一个proprety, 用Temp : bookMark时就会报错
var
maxcount,j:integer;
begin
if RadioGroup2.ItemIndex=0 then
begin
if not Query1.IsEmpty then
begin
if DbgridEh1.SelectedRows.Count=0 then
begin
showmessage('请选择要批审的记录!前头框边颜色为黑色为选中.');
Exit;
end else
begin
if MessageBox(Handle,'你确定批量审批这些记录吗?','询问',
MB_ICONQUESTION+MB_YESNO)=mrYes then
begin
maxcount:=DbGridEh1.SelectedRows.Count - 1;
for j := 0 to DbgridEh1.SelectedRows.Count - 1 do
begin
maxcount:=DbgridEh1.SelectedRows.Count - 1;
with DbGridEh1.DataSource.DataSet do
begin
GotoBook(pointer(DBGridEh1.SelectedRows.Items[j]));
if Query1SPJG.Value='0' then
begin
Query1.Edit;
Query1SPSL1.Value:=Query1SL.Value;
Query1SPZJ1.Value:=Query1YSZJ.Value;
Query1SPJG.Value:='1';
//单项小于10万元的项目赋值下一级
if not ((Query1SPSL1.AsFloat=0) or (Query1SPSL1.AsFloat=null)) then
begin
if (Query1SPZJ1.AsFloat/Query1SPSL1.AsFloat<10) then
begin
Query1SPSL2.Value:=Query1SPSL1.Value;
Query1SPZJ2.Value:=Query1SPZJ1.Value;
end;
end;
Query1.Post;
Query1.ApplyUpdates;
Query1.CommitUpdates;
end;
end;
end;
showmessage('数据批量审批完毕!');
OpenQuery(Query1,Query1.SQL.Text);
Query1AfterScroll(Query1);
end;
end;
end;
end else
begin
showmessage('请选择未批的数据审批!');
exit;
end;
end;