Hi Sergey,
I'm still not quite able to get this to work. In order to get TableSort.Pas to compile I needed to make the following substitutions (you may want to correct the unit for these):
table.RowCount -> table.Rows.Count
table.ColCount -> table.Rows[0].Count
rve.RefreshAll -> rve.Refresh (not sure if this is, perhaps, the problem)
After making these changes in TableSort.Pas and putting the following code on a button:
procedure TFStatsAdv.BBSortClick(Sender: TObject);
var
rvet: TCustomRichViewEdit;
table: TRVTableItemInfo;
Column: integer;
Ascending, IgnoreCase : Boolean;
begin
Column := 4;
IgnoreCase := True;
Ascending := True;
if not RichViewEdit1.GetCurrentItemEx(TRVTableItemInfo, rvet, TCustomRVItemInfo(table)) then
exit;
// display your modal form allowing choosing sort options
// and column (in range 0..table.ColCount-1)
SortCurrentTable(RichViewEdit1, Column, Ascending, IgnoreCase);
end;
The SortCurrentTable appears to execute properly, calling CreateSortedTable, etc. However, the operation completes with the original table totally selected but not sorted in any way. I think that what is not occurring is that the sorted copy of the table is not replacing the original copy of the table but I don't know why.
Any suggestions?
Dick
TableSort.Pas Problems
-
- Posts: 148
- Joined: Wed Dec 07, 2005 2:02 pm
- Contact:
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: