Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - SORT messes up actual underlying data of row selec
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

SORT messes up actual underlying data of row selec

 Post Reply Post Reply
Author
Message
Nexxes View Drop Down
Newbie
Newbie


Joined: 13 November 2009
Location: United States
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nexxes Quote  Post ReplyReply Direct Link To This Post Topic: SORT messes up actual underlying data of row selec
    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?
Back to Top
Nexxes View Drop Down
Newbie
Newbie


Joined: 13 November 2009
Location: United States
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nexxes Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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....
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.