在DbGrid中,不按下Ctrl,单击鼠标如何实现多选?谢谢

解决方案 »

  1.   

    有了dbgrid1.options.dgmultiselect:=true;
    必须按下Ctrl键,才能实现多选,
      

  2.   

    修改源代码,把以下内容
    if Select and (ssShift in Shift) then
    改为if Select then
      

  3.   

    记住是在DBGRIDS单元里:
        if ssCtrl in Shift then //这句改为if true then
    还有把以下这段去掉:
            if ssCtrl in Shift then
                  CurrentRowSelected := not CurrentRowSelected
                else
                begin
                  Clear;
                  CurrentRowSelected := True;
                end;
    改为CurrentRowSelected := not CurrentRowSelected;