Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Dataset with a Sort and you reload dataset - does not sort automatically
Tue, Oct 29 2013 1:48 PMPermanent Link

Walter Matte

Tactical Business Corporation


I need to remove the sort and then add the sort after load to get the dataset sorted ....


procedure TfrmTime.RecruitersAfterLoad(Sender: TObject);
begin

 Recruiters.Columns['LoginName'].SortDirection:=sdNone;
 Recruiters.Sort;

 Recruiters.Columns['LoginName'].SortDirection:=sdAscending;
 Recruiters.Sort;

end;


Walter
Tue, Nov 5 2013 3:14 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Walter,

<< I need to remove the sort and then add the sort after load to get the
dataset sorted .... >>

Got it, thanks.  A fix will be in the next build.

Tim Young
Elevate Software
www.elevatesoft.com
Fri, Nov 15 2013 5:02 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Walter,

<< I need to remove the sort and then add the sort after load to get the
dataset sorted .... >>

I spoke too soon on this - I checked it out and I can't replicate what
you're seeing.  When I try it here, the row sort is updated, as expected,
after the rows are loaded.  Can you send me a project that reproduces what
you're seeing ?

Thanks,

Tim Young
Elevate Software
www.elevatesoft.com
Sat, Nov 16 2013 5:59 AMPermanent Link

Walter Matte

Tactical Business Corporation

Will send you a project....  but I should have given more explanation... but when I was writing the post I forget the issue... so I went back and recreated it.

I have a form being use to display a list of jobs to select from and I want it sorted by job code.

In the form on the dataset AfterLoad I set the column to sort on and call sort.

Forms are all created automatically.

There is a main form that has a button to allow them to call the form to list the jobs.  The FIRST time the form is called and displayed the list is sorted,  all subsequent calls to the listed is not sorted.   (unless I remove the sort and put it back on the column).

Walter
Sun, Nov 17 2013 3:57 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Walter,

<< Will send you a project....  but I should have given more explanation...
but when I was writing the post I forget the issue... so I went back and
recreated it.  >>

Thanks.  The issue was the TDataSet.Close - that was clearing the sorted
columns, but not updating the SortDirection.  But, clearing the sort
settings is not very intuitive and unnecessary, so I've made it so that the
sort settings are preserved across the close.

BTW, there's now a SingleClickCheckBoxes property for the grid (default
False) that allows you to specify that you want the check boxes clickable
with a single click.

Tim Young
Elevate Software
www.elevatesoft.com
Image