Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting Columns 1

Status
Not open for further replies.

siraj777

Programmer
Aug 22, 2002
27
0
0
IN
There are 5 datawindows. The first datawindow is sorted on column A by selecting it from sort dialog box. (dw_1.Setsort(null) - columns are selected dynamically) How to sort the remaining 4 datawindows on the same column/s without prompting the dialog.

In other words how to get the column/s sorted on first datawindow.

 
Hi, you can define the sorted columns in the datawindow painter menu Rows>Sort , or you can use ORDER BY keyword in your Query.
Hope this helps.

Have fun!
 
Hi,

try the following :

dw_1.Setsort(null)
ls_sort = dw_1.Describe("DataWindow.Table.Sort")
dw_2.SetSort(ls_sort)
dw_2.Sort()

Hope it will help

Thierry
 
If the result-sets are similar, you may use the ShareData() on all the dw's which is simply automatic.

Otherwise, after you sort the dw_1:

//////////////////////////////////////////////////
string ls_Sort
//
ls_Sort = dw_1.Object.DataWindow.Table.Sort
//
IF ls_Sort <> &quot;?&quot; THEN
//
dw_2.SetSort( ls_Sort )
dw_3.SetSort( ls_Sort )
dw_4.SetSort( ls_Sort )
dw_5.SetSort( ls_Sort )
//
dw_2.Sort()
dw_3.Sort()
dw_4.Sort()
dw_5.Sort()
//
END IF

//////////////////////////////////////////////////

Hope this helps...

---
PowerObject!
-----------------------------------------
PowerBuilder / PFC Developers' Group
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top