MSFlexGrid Scrolling problem
Posted on 2004-10-06
Hi there one more time.
I have a form "FLLista" with MSFlexGrid with a list of customers. When user hits Return, it shows customer info in a form "FClients". In this form, hitting PageUp or PageDown keys, it shows previous / next customer in FClients, and I also change current row in MSFlexGrid, so when user closes FClients, it shows current customer in MSFlexGrid, with different cellbackcolor.
Problem is when it has moved several customers away from first one and MSFlexGrid has to do a scrolling (up or down). For example, say we have customer A to customer Z in a 20-rows MSFlexGrid. I see customer A info in FClients, and move forward to customer W. If I close FClients, I still see first 20 customers (A to T) in the MSFlexGrid listing. But if I hit up arrow, for example, then row changes to customer V (one previous to customer W), and it makes scrolling if necessary. So when I do the MSFlexGrid.row=MSFlexGrid.Row+1, it works, but if scrolling is needed when MSFlexGrid does not have the focus, then it's not doing it.
I wonder if there is something similar to the EnsureVisible property of the ListView.
Code in the KeyDown event:
If FLlista.MSFlexGrid1.Row < FLlista.MSFlexGrid1.Rows - 1 Then
'change current row
FLlista.MSFlexGrid1.Row = FLlista.MSFlexGrid1.Row + 1
Set RsLlistaC = CnPermanent.Execute("ae_findclientfromid " & FLlista.MSFlexGrid1.RowData(FLlista.MSFlexGrid1.Row))
'show customer in FClients
Thanks in advance for your time.