Print Page | Close Window

SORT messes up actual underlying data of row selec

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=17014
Printed Date: 15 November 2024 at 1:23pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: SORT messes up actual underlying data of row selec
Posted By: Nexxes
Subject: SORT messes up actual underlying data of row selec
Date Posted: 27 July 2010 at 5:57pm
Hey All,
 
I'm doing a mock email client so I return records to the report control and select a record and click my
reply button and it returns the correct data corresponding to the row in the report control that I selected.
 
Say if I click on row 2 it returns the actual data in row2 I can see visually. Row 10 etc etcc..
 
BUT
 
When I click a column header to sort the data by that column, it visually sorts the data but if I click
on row 2 and reply. It returns what was previously in ROW2 data, not the new data in row2 because of the sort.
 
So it's like the control sorts the data in the control visually but somewhere keeps the underlying data it
uses to return data UNSORTED?
 
Anyone seen this?



Replies:
Posted By: Nexxes
Date Posted: 28 July 2010 at 4:24pm
I have found a workaround for the issue.
 
I was using 'EMAIlId = CLng(wndReportControl.Records(wndReportControl.FocusedRow.Index).Tag) to access the current selected record in the report control
 
THAT works fine if its NOT SORTED. Once you sort by a column it returns the previous record (unsorted) data. Really dumb.
 
So to work arround it I have code in the MOUSE DOWN event and use HITTEST to get the current selected row which works even after sorted.
MOUSE DOWN EVENT
Set hitROW = wndReportControl.HitTest(x, y).Row
If Not hitROW Is Nothing Then
    ReportCONTROLCurrentTAGvalue = CLng(hitROW.Record.Tag)
end if
 
My REPLY SUB
If ReportCONTROLCurrentTAGvalue <= 0 Then
'if they havent selected a row return the default selected (first row or record)
    ReportCONTROLCurrentTAGvalue = CLng(wndReportControl.Records(wndReportControl.FocusedRow.Index).Tag)
End If
 
EMAIlId = ReportCONTROLCurrentTAGvalue
 
 
The only issue here is if they havent clicked a record, I have to pass the first row item and again, if its sorted it doesnt work so its
really only a 90% workaround.
 
I would think this is a GLARING ISSUE that needs to be resolved.
 
wndReportControl.FocusedRow.Index
 
should STILL return the correct index even after a sort.. IT DOES NOT.


Posted By: Aaron
Date Posted: 30 July 2010 at 2:03pm
Hi,
 
Did you try with wndReportControl.SelectedRows(0).Record.Index
 
Don't know if SelectedRows is destroyed when sorting is applied... But you can try it...
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....



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