锁定DBgrid的前几列,即在记录左右滚动时,保证锁定的几列不移动,但问题是移动滚动条时锁定的几列列名会消失,怎么解决这个问题,大家有什么好办法么?

解决方案 »

  1.   

    判断滚动了多少列,然后从固定列中第一列开始,把index顺序向后增加
      

  2.   

    考虑一下dev的grid吧,它可以固定任意列
      

  3.   

    用dbgrideh
    Procedure Terp.sd(component:string;form:string);
    begin
     with  application.FindComponent(form) as tform  do
     begin
     tdbgrideh(FindComponent(component)).FrozenCols:=tdbgrideh(FindComponent(component)).Selection.Columns.Count;
     end;
    end;
      
    dbgrideh1.FrozenCols:=dbgrideh5.Selection.Columns.Count;
      

  4.   

    infopower4000也不错 里面的TwwDBGrid可以任意设定固定列
      

  5.   

    用两个DbGrid.即可。好用得很。