Solved

remember the sort criteria of a datawindow

Posted on 2004-03-23
6
296 Views
Last Modified: 2013-12-26
Hi!

How to save the current sort criteria of a datawindow to aply another and later return to the first sort?

Thank you!
0
Comment
Question by:tsirakua
6 Comments
 
LVL 14

Accepted Solution

by:
sandeep_patel earned 125 total points
Comment Utility
hi,
let's take an example that your datawindow has two columns emp_code and emp_name and you specified the sort criteria while designing the datawindow so your sort criteria is say
'emp_name A'.
now through script u can get this value by using

String is_sort  // instance variable
is_sort = dw_1.Object.datawindow.table.sort

you can store this value in instance variable, before applying another sort scriteria and can reapply later with
dw_1.setsort(is_sort) and
dw_1.sort()

hope it will work for u..if not reply...
-sandeep
0
 
LVL 18

Expert Comment

by:diasroshan
Comment Utility
hi  tsirakua,
try the following code in the clicked event of a button...assuming that ur dw has retrieved....

String ls_sort, ls_caption

ls_caption = cb_sort.Text
If Upper(ls_caption) = 'SORT' Then
      is_oldsort = dw_1.Object.DataWindow.Table.Sort  // remember old sort criteria
      SetNull(ls_sort )
      dw_1.SetSort(ls_sort)   // ask user for sort criteria
      dw_1.Sort()
      cb_sort.Text = 'Release'
Elseif Upper(ls_caption) = 'RELEASE' Then
      dw_1.SetSort(is_oldsort)  // apply old sort criteria
      dw_1.Sort()
      cb_sort.Text = 'Sort'
End If      

let me know for further clarifications......

Cheers...
Rosh
0
 
LVL 18

Expert Comment

by:diasroshan
Comment Utility
...oops ...a bit late....

...anyways just forgot to mention is_oldsort is an instance variable...

Cheers,,
Rosh
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 14

Expert Comment

by:sandeep_patel
Comment Utility
Hi! Rosh,

don't worry man...better luck for next time..and still it's not closed....it's open........:)

-sandeep
0
 
LVL 8

Expert Comment

by:Vikas_Dixit
Comment Utility
Hey this EE should have something like "Row (Page) changed between retrieve and update" :))
--Vikas
0
 

Author Comment

by:tsirakua
Comment Utility
Thank you
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now