Print Page | Close Window

Sorting problem

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=10390
Printed Date: 09 May 2024 at 9:42pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Sorting problem
Posted By: AbhishekGoenka
Subject: Sorting problem
Date Posted: 29 April 2008 at 3:09am

I am using Report control

I applied the sort command by clicking on the column header. The view is changed. but when I traverse the row programically I found the same sequence as before sorting

How the change the sequence of rows when sorting is applied



Replies:
Posted By: Aaron
Date Posted: 29 April 2008 at 6:28am
Hi,
 
When adding records to the ReportControl they will have an index in the order you added them, OK?
 
If you sort a column, the index of a record does not change, only the order will change. If you want to traverse the ReportControl as you see them you have to traverse the ReportRows.
 
Just to give you an example to see the difference when a column has been sorted. Just add a few records to ReportControl and call ShowDifference. Sort one column and call ShowDifference again. The first time you will have 0,1,2,3,4,5 after sorting you will have a different values. 
 
Private Function ShowDifference() 
    Dim row As ReportRow
    For Each row In wndReportControl.Rows
        MsgBox row.record.Index
    Next row
End Function
 



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net