Jump to content


Problem with DeleteRow and vertical scrollbar


  • Please log in to reply
No replies to this topic

#1 GoustiFruit

GoustiFruit
  • Members
  • 77 posts

Posted 27 May 2012 - 11:05 PM

Hi,

I'm populating a tree from a database with hierarchical data that would require very complex queries if I was to do it in one step, so I do it in two steps: first one I'm filling the data, and second one I'm deleting those rows that don't have children because of my filtering options. So far so good.

The problem is that in some cases after deleting rows, the vertical scrollbar (and scrolling - mouse or keyboard) is disabled though I have rows that go below the bottom of the current visible "page". My code is nothing fancy:

grd.BeginUpdate;
for i1 := grd.RowCount - 1 downto 0 do
  if grd.GetLevel(i1) < 2 then
	if not grd.Row[i1].HasChildren then
	  grd.DeleteRow(i1);
grd.EndUpdate;

Do you have any idea on how to fix it ?

Thanks.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users