解决方案 »
- 前几天能用,今天想修改下就编译不了了.大家帮忙看看
- 关于TCompoprt在delphi7动态库中无法接收数据的解决方法。
- 请 konhon(优华) 进来接分
- 问一个网络版数据库的问题,请大家指教.
- 如何获得系统语种等信息?
- Tedit怎么限制输入为数字
- 请问在Delphi打印时怎样才能在每条记录前加上个行号?
- 怎么打印RichEdit,StringGrid等控件中的内容。
- 关于日期时间类型的一些问题?
- 请问:Microsoft开发工具中相当于Delphi的是什么?还有其他与Delphi相当的产品吗?谢谢!!
- 关于ADO和ACCESS的一段代码.难道都要这样连接吗?高手来吧!
- 老千来,有时相商,重要~~
begin
if dbgrid1.currentrows.selected then
begin
...
end;
query1.next;
end;
:)
TDataSet *pDS = gridCtn->DataSource->DataSet;
for(int i=0;i<gridCtn->SelectedRows->Count;i++)
{
pDS->GotoBook((void *)gridCtn->SelectedRows->Items[i].c_str());
cmdUpdateCtn->Parameters->ParamByName("ctnno")->Value=pDS->Fields->FieldByName("ctnno")->AsString;//qryCtn->FieldByName("ctnno")->AsString;
cmdUpdateCtn->Parameters->ParamByName("arrcyd")->Value=pDS->Fields->FieldByName("arrcyd")->AsString;//qryCtn->FieldByName("arrcyd")->AsString;
try
{
cmdUpdateCtn->Execute();
}
catch(...)
{
MessageDlg("数据保存错误!\n请稍候重试!",mtError,TMsgDlgButtons()<<mbYes,0);
}
}
不过我也有个问题
dbgrid的multiselect属性,其实不是真正的管用,对于shift+click不灵
如果你有答案,希望多交流
SavePlace: TBook;
PrevValue: Variant;
begin
with Table1 do
begin
{ get a book so that we can return to the same record }
SavePlace := GetBook; { move to prior record} FindPrior; { get the value } PrevValue := Fields[0].Value; {Move back to the book this may not be the next record anymore
if something else is changing the dataset asynchronously }
GotoBook(SavePlace);
{ Set the value }
Fields[0].Value := PrevValue;
{ Free the book }
FreeBook(SavePlace);
end;end;
我记得好像是Ctrl+Click~~~
你在试试~~呵呵~~
click,ctrl+click和shift+click都是windows的标准操作,作用不同