CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Change name of sortColum

General discussion

by etwoss » 11 Apr 2014 07:43

Hi

In a grid i have a column with a price like '200 USD'
With this format sorting is inpossible.

So i have added a hidden column with only the numeric values (200 in this case)
if sorted on column (200 USD) i want to change the name of the Sort column to the name of the column with '200'

for i := 0 to ASortItems.Count - 1 do
begin
if SameText(ASortItems[i].Name, 'Cost') then
begin
ASortItems[i].Name := 'CostHidden'
Break;
end;
end;

HowEver the name is readOnly

Eric
etwoss
 
Posts: 1205
Joined: 06 Feb 2014 08:58

by Jorge Sousa » 11 Apr 2014 10:10

We've to change it in our code, and allow you to write the property

Please confirm if you're interested for us is indiferent.
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by etwoss » 11 Apr 2014 11:49

Hi

Yes please,really would like that!
Is there a workaround?

Eric
etwoss
 
Posts: 1205
Joined: 06 Feb 2014 08:58

by Jorge Sousa » 11 Apr 2014 12:32

Is there a workaround?


No
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by etwoss » 15 Apr 2014 10:27

Hi

Due to your change to make the 'Name' property of a TIWCGJQGridSortItems item writable this trick works:

Code: Select all
var
  i : Integer;
begin
  for i := 0 to ASortItems.Count - 1 do
  begin
    if SameText(ASortItems[i].Name, 'Cost') then
    begin
      ASortItems[i].Name := 'CostHidden';
      Break;
    end;
  end;

  GridNewOrderList.SortBy(ASortItems);


The column 'Cost' is not really sortable because it contains values like '100 USD' and '2 USD'.
The Columns CostHidden (A hidden column) contains only the 100 and 2 values
So when sorting on 'Cost' i change the name to 'CostHidden'. This way sorting is done right!

Thanks for making this change!

Eric
etwoss
 
Posts: 1205
Joined: 06 Feb 2014 08:58

by Jorge Sousa » 15 Apr 2014 10:35

no prob :)
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58


Return to General - Archive

cron

Who is online

Users browsing this forum: No registered users and 2 guests

Contact Us.