Welcome! Log In Create A New Profile

Advanced

Re: Nullify the sort in Table

Posted by sivakrith 
Re: Nullify the sort in Table
January 06, 2021 02:23PM
Hello,
Using Windev 22

Searching for a way to disable sort [ eg. TableDisableSort], similar to TableDisableFilter.

I add rows to a table, running a query, and adding rows to a table with TableAddLine. Rows get added as the last row. Then I loop through the table,
1. add a few column values,
2. sort it,
3. Display the table as a report

Now when I re-run the report without closing the window, the rows added to the table get sorted automatically. This makes the looping to miss few rows for processing.

When this report is run for the first time, there is no sort for that table defined. When I run the program a second time, without closing the window, I want that same status (no sort) to be set. [ Since I sort after adding rows, it takes that sorting order by default ].

Is there any way to clear the sorting anyway? eg. like TableDisableSort similar to TableDisableFilter

Happiness Always
BKR Sivaprakash
Al
Re: Nullify the sort in Table
January 06, 2021 03:02PM
Hello Sivaprakash

From the help on TableSort


Canceling a sort that was previously defined on a memory Table or TreeView Table control

<Result> = <Table control>.Sort(<False>)


<Result>: Boolean

•True if the sort was canceled,
•False if a problem occurred.

Regards
Al
Re: Nullify the sort in Table
January 07, 2021 01:41PM
Thanks, AI

But this is not working. I get the following error in the line Table_TrialBalanceAsOn.Sort(False)
Error:'sort' element not found in 'Table_TrialBalanceAson' element.

The other syntax is working fine
TableSort(Table_TrialBalanceAson, "COL_SLNo")

I add records to Table_trialBalanceAsOn only through
nRow = TableAddLine(Table_TrialBalanceAson)

Any suggestion?

Happiness Always
BKR Sivaprakash
Argus
Re: Nullify the sort in Table
January 07, 2021 03:28PM
Is it so hard to read the help?

Canceling a sort that was previously defined on a memory Table or TreeView Table controlHide the details
<Result> = TableSort(<Table control> , <False>)
Re: Nullify the sort in Table
January 08, 2021 07:12AM
Thanks Argus,

My bad. Don't know how I missed this part in the help. Thanks.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: