知道了告诉我。好久没动了。
[email protected]
10652093
http://nizvoo.myrice.com

解决方案 »

  1.   

    你打算如何应用字段值,如果只是希望读出,可以这样写:for i:= 0 to query1.recordcount -1 do
    begin
      if dbgrid1.currentrows.selected then
      begin
        ...
      end;
      query1.next;
    end;
      

  2.   

    DBGRid中多选后是定义了一个书签数组,循环定位每个书签并读值。
      

  3.   

    property SelectedRows: TBookList;有帮助例子。
      

  4.   

    对不起,老兄,我只有bcb的一段程序,相信你看懂应该没有问题
    :)
    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);
        }
    }
      

  5.   

    我执行的是一段数据的批更新
    不过我也有个问题
    dbgrid的multiselect属性,其实不是真正的管用,对于shift+click不灵
    如果你有答案,希望多交流
      

  6.   

    用TBookMark吧~~很简单的~~看看Delphi的帮助~~var
       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;
      

  7.   

    TO:tl_ang(smile) ~~~
    我记得好像是Ctrl+Click~~~
    你在试试~~呵呵~~
      

  8.   

    ctrl+click也不能选择一个区间,只能保持原来的选择,一次选择一个
    click,ctrl+click和shift+click都是windows的标准操作,作用不同
      

  9.   

    DBGird好像就支持Ctrl+Click~~好像Shift+Up或者是Shift+Down也可以~~我记不清楚了~~