HI,
Why does the row move if I have sort on the header and the values is the same and I keep hitting the sort.
Regards
MLB
HI,
Why does the row move if I have sort on the header and the values is the same and I keep hitting the sort.
Regards
MLB
Marie -
To expand on John's answer: when we do a column sort we expect JUST the one column to be considered in the sorting process - that is what we intuitively think should happen.
However, the if a DW has more than one column, the other columns will still magically get involved, even though they really should not have any effect on the SORT command you issued. I have seen the same thing happen to me, and it has been this way forever.
The good news is that usually you can either ignore it, or as a quick work-around sort on another column header, then the original one to get back to the sequence you expect.
Another work-around:
ll_rc = this.setredraw (false)
ll_rc = this.SetSort ("")
ll_rc = this.Sort()
ll_rc = this.SetSort ("ord_vendor_order_vendor_code ASC")
ll_rc = this.Sort()
ll_rc = this.setredraw (true)
Later -
Olan
HI,
Here I only sort on Vendor No.
I just keep hitting it and the row moves.
Regards
MLB
Your question is a little cryptic, Marie...
I assume your app has code that sorts the contents of a DataWindow when the user clicks on a column heading text label, and that, in your example, you click on either the Vendor No. or Description column heading and result after sorting shows the rows in a different order (as evidenced by the order number). Correct?
When you sort on the values contained in a single column and there are multiple rows containing the same value in that column, then this can happen because there are no additional conditions that will enforce the relative order of the rows to be "preserved". The DataWindow is doing exactly what you requested it do and nothing more. You're assuming it's going to do something you haven't told it to do.
If you want the sort to take into account additional columns you'll have to either use the PB Sort dialog window or enhance the column-heading-click/sort user interface to take multiple columns into consideration.
Regards, John
what is your sort