Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sortable grids
Message
 
 
To
17/11/1998 09:39:31
Elyse Pomerantz
Dynamic Data Concepts, Inc.
Brooklyn, New York, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00158201
Message ID:
00158519
Views:
14
Elyse,

I add a lblHeaderArrow to the parent container. In the Header class Click() method it calls the SetPosition method.
* Init Method
lparameter pcGridName

local laFonts[1]

afont( laFonts )
with this
   if ( ascan( laFonts, "Wingdings 3" ) > 0 )
      .FontName = "wingdings 3"
      .mcUp = 'p'
      .mcDown = 'q'
   else
      .FontName = "wingdings"
      .mcUp = chr(225)
      .mcDown = chr(226)
   endif
   .FontBold = .t.
   .ForeColor = ColorFactor( this.parent.BackColor, 0.5 )
   .Caption = ""
   .mcGridName = pcGridName
   .MousePointer = 99
   .MouseIcon = "down.cur"
endwith
endproc

* SetPosition Method
local loGrid, loCol

loGrid = eval( this.mcGridName )
for each loCol in loGrid.Columns
   if ( loCol.Name == this.mcColumnName )
      with this
         .Caption = iif( loCol.Header1.mlAscending, .mcUp, .mcDown )
         .Top = objtoclient( loCol.Header1, 1 ) + 2
         .Left = objtoclient( loCol.Header1, 2 ) + objtoclient( loCol.Header1, 3 ) - .Width
         .Visible = .t.
      endwith
      exit
   endif
endfor
>I want to give my users the ability to sort their grids by any column, ascending or descending. Is there a way to get an indicator (arrow, etc.) to appear next to the caption of the sorted column and show whether it's asc or desc?
>
>Also, if I reverse the sort order on a grid and my current row becomes the last row, all of the other rows scroll upwards, leaving only the current (last) row visible. Is there a way to prevent it from scrolling and to show more rows?
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform