delphi - cxGrid will not scroll upwards -
i have encountered strange issue cxgrid. after executing query fetch records, records show in grid. simple query:
'select * mytable order name asc'
however,if try , select first record in grid,the grid jumps random record in middle of grid. can not scroll first record in grid 1 grid jumps to. however, beyond record can scroll , down. can not scroll middle upwards nor can select record on there. seems grid stuck on middle record.
if change datacontroller
gridmode = true
then can scroll without problem loose functionality of grid. not dataset issue when replace grid normal grid scrolling functional.
so wondering if bug of sort or setting in grid turned on/off accident.
ps. findpanel visible.
in case helps, below code , dfm of minimalist cxgrid project works fine me , doesn't show behaviour describe. if works you, too, perhaps identify difference in project causing problem.
code:
type tform1 = class(tform) cds1: tclientdataset; datasource1: tdatasource; cxgrid1dbtableview1: tcxgriddbtableview; cxgrid1level1: tcxgridlevel; cxgrid1: tcxgrid; cds1id: tintegerfield; cds1name: tstringfield; cxgrid1dbtableview1id: tcxgriddbcolumn; cxgrid1dbtableview1name: tcxgriddbcolumn; procedure formcreate(sender: tobject); private { private declarations } protected public { public declarations } end; var form1: tform1; implementation {$r *.dfm} procedure tform1.formcreate(sender: tobject); var i, j, id : integer; name : string; begin cds1.createdataset; := 1 26 begin j:= 1 26 begin id := * j; name := chr(ord('a') + - 1) + chr(ord('a') + j - 1); cds1.insertrecord([id, name]); end; end; cds1.first; caption := inttostr(cds1.recordcount); cxgrid1dbtableview1.datacontroller.filter.beginupdate; try cxgrid1dbtableview1.datacontroller.filter.root.additem(cxgrid1dbtableview1name, folike, '%a', '%a'); cxgrid1dbtableview1.datacontroller.filter.endupdate; cxgrid1dbtableview1.datacontroller.filter.active := true; end; end;
dfm:
object form1: tform1 left = 259 top = 103 autoscroll = false caption = 'form1' clientheight = 314 clientwidth = 444 color = clbtnface font.charset = default_charset font.color = clwindowtext font.height = -11 font.name = 'ms sans serif' font.style = [] oldcreateorder = false position = poscreencenter scaled = false oncreate = formcreate pixelsperinch = 96 textheight = 13 object cxgrid1: tcxgrid left = 0 top = 0 width = 444 height = 314 align = alclient taborder = 0 object cxgrid1dbtableview1: tcxgriddbtableview navigator.buttons.custombuttons = <> datacontroller.datasource = datasource1 datacontroller.keyfieldnames = 'id' datacontroller.summary.defaultgroupsummaryitems = <> datacontroller.summary.footersummaryitems = <> datacontroller.summary.summarygroups = <> filterrow.visible = true optionsview.groupbybox = false object cxgrid1dbtableview1id: tcxgriddbcolumn databinding.fieldname = 'id' end object cxgrid1dbtableview1name: tcxgriddbcolumn databinding.fieldname = 'name' end end object cxgrid1level1: tcxgridlevel gridview = cxgrid1dbtableview1 end end object cds1: tclientdataset aggregates = <> indexfieldnames = 'name' params = <> left = 16 top = 24 object cds1id: tintegerfield fieldname = 'id' end object cds1name: tstringfield fieldname = 'name' size = 40 end end object datasource1: tdatasource dataset = cds1 left = 56 top = 24 end end
Comments
Post a Comment