View Issue Details

IDProjectCategoryView StatusLast Update
0003229JEDI VCL00 JVCL Componentspublic2007-01-03 12:39
ReporterRamengoAssigned Toobones 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.00 
Target VersionFixed in Version3.30 
Summary0003229: TJvDBTreeView not scrolling
DescriptionItem selection is not updated if the linked dataset scrolls.
For example if a dataset scrolls, a linked DBGrid would move the selection to the current record. Instead, TJvDBTreeView does not.
TagsNo tags attached.

Activities

obones

2006-04-04 03:44

administrator   ~0008858

Can you test with the latest version and let us know if the problem is still there? If yes, I would appreciate if you could post the zipped sources of a sample application showing this behaviour.

2006-05-10 05:23

 

DelphiTestCase.zip (36,741 bytes)

Ramengo

2006-05-10 05:26

reporter   ~0009268

Try this testcase. You must have Firebird 1.5 up and running.
Compile and run the program, expand the treeview and select any item; you'll note that relative DBGrid will update selection.
Now try navigating through DBGrid; the Treeview won't update the selection.

ivan_ra

2006-05-10 06:21

developer   ~0009269

This can take significant time on big datasets. To synchronize dbgrid with JvDBTreeView You can write own handler for Dataset.AfterScroll:

procedure TForm1.IBDMasterDetailsAfterScroll(DataSet: TDataSet);
var
  OldAfterScroll:TDataSetNotifyEvent;
begin
  with JvDBTreeView2 do
  if (Selected = nil)
  or (TJvDBTreeNode(Selected).MasterValue<>DataSet.FieldByName(MasterField).Value)
  then
  begin
    OldAfterScroll := DataSet.AfterScroll;
    DataSet.AfterScroll := nil;
    try
      SelectNode(DataSet.FieldByName(JvDBTreeView2.MasterField).Value)
    finally
      DataSet.AfterScroll := OldAfterScroll;
    end;
  end;
end;

You must assign this handler AFTER dataset open (to escape infinite loop), for example in Form1.OnCreate tvent handler

Ramengo

2006-05-11 03:22

reporter   ~0009274

I've added the procedure and assigned on TForm1.FormCreate after IBDMasterDetails.Open.
It seems to work but the item selection on the treeview is not shown.

ivan_ra

2006-05-11 04:23

developer   ~0009275

Set property HideSelection = false

Ramengo

2006-05-11 05:37

reporter   ~0009277

Thank you Ivan.

obones

2006-06-09 03:06

administrator   ~0009524

So, ivan, what should be done here? Can we close the issue?

2006-06-09 05:56

 

DelphiTestCase1.zip (39,122 bytes)

ivan_ra

2006-06-09 05:57

developer   ~0009545

I think this can be closed. May be add DelphiTestCase into Examples folder?

obones

2006-07-29 07:44

administrator   ~0009906

Make the database smaller (around 500k) and I'll add it to the examples.
Better yet, have it generated at the start of the program from random values.

obones

2007-01-03 12:39

administrator   ~0010499

Ok, this is now considered fixed in SVN

Issue History

Date Modified Username Field Change
2005-09-23 05:14 Ramengo New Issue
2006-04-04 03:44 obones Note Added: 0008858
2006-04-04 03:44 obones Status new => feedback
2006-05-10 05:23 Ramengo File Added: DelphiTestCase.zip
2006-05-10 05:26 Ramengo Note Added: 0009268
2006-05-10 06:21 ivan_ra Note Added: 0009269
2006-05-11 03:22 Ramengo Note Added: 0009274
2006-05-11 04:23 ivan_ra Note Added: 0009275
2006-05-11 05:37 Ramengo Note Added: 0009277
2006-06-09 03:06 obones Note Added: 0009524
2006-06-09 05:56 ivan_ra File Added: DelphiTestCase1.zip
2006-06-09 05:57 ivan_ra Note Added: 0009545
2006-07-29 07:44 obones Note Added: 0009906
2007-01-03 12:39 obones Status feedback => resolved
2007-01-03 12:39 obones Fixed in Version => Daily / SVN
2007-01-03 12:39 obones Resolution open => fixed
2007-01-03 12:39 obones Assigned To => obones
2007-01-03 12:39 obones Note Added: 0010499