![]()  | 
 
SORT messes up actual underlying data of row selec | 
 
    Post Reply  
   | 
  
| Author | |
   
   Nexxes  
   
   Newbie  
   Joined: 13 November 2009 Location: United States Status: Offline Points: 6  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Topic: SORT messes up actual underlying data of row selecPosted: 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?  
    | 
 |
![]()  | 
 |
   
   Nexxes  
   
   Newbie  
   Joined: 13 November 2009 Location: United States Status: Offline Points: 6  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     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. 
    | 
 |
![]()  | 
 |
   
   Aaron  
   
   Senior Member  
   Joined: 29 January 2008 Status: Offline Points: 2192  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     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....  | 
 |
![]()  | 
 |
    Post Reply  
   | 
  |
|       
  
  Tweet   	
    | 
 
| Forum Jump | Forum Permissions  ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum  |