Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid Partition
Message
De
23/07/2002 10:28:52
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
23/07/2002 10:13:35
Steven Dyke
Safran Seats USA
Texas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
00681628
Message ID:
00681646
Vues:
15
>I have a grid that has more columns than my form is wide. I have partitioned the grid on the first column so the document number is always in view. Can I make the second part of the grid hide the first column so it is not shown twice?
* Create a form with a custom property named LockCount
* This property would hold number of columns to lock on left
* Add your grid and build as usual
* Copy&paste the code below to their target methods

*Grid.Init
With this
  lnVertScrollWidth = iif(.ScrollBars < 2, 0, sysmetric(5) )
  lnRecAndDelMarkWidth = ( iif(.DeleteMark,0.6,0) + ;
    iif(.RecordMark,0.6,0) ) * lnVertScrollWidth
  lnGridLineWidth = iif(.GridLines < 2, 0, .GridLineWidth )
  lnTotWidth = 0
  For ix = 1 to thisform.lockcount
    lnTotWidth = lnTotWidth + .Columns(ix).Width + lnGridLineWidth
  Endfor
  .Partition = lnTotWidth + iif(.GridLines < 2, 4, .GridLineWidth ) + ;
    lnVertScrollWidth + ;
    max(lnRecAndDelMarkWidth, 1)
  .ActivateCell(1,thisform.lockcount+1) && Setfocus to 2nd panel
  do while .LeftColumn<thisform.LockCount+1
  .DoScroll(5)    && Scroll right
  enddo
Endwith


* Grid.BeforeRowColChange
LPARAMETERS nColIndex
With this
  Do case
  Case inlist(lastkey(),9,4,2) && Right
    If .Panel = 0 and this.Columns(nColIndex).ColumnOrder = thisform.lockcount
      Nodefault
      .Columns(1).Setfocus()
      .Panel = 1
      .Columns(thisform.lockcount+1).Setfocus()
    Endif
    If .Panel = 1 and  .Columns(nColIndex).Columnorder=.ColumnCount
     	nodefault    	
      .Columns(thisform.lockcount+1).Setfocus()
      .Panel = 0
      .Columns(1).Setfocus()
    Endif
  Case inlist(lastkey(),15,19,26) && Left
    If .Panel = 0
    	if .Columns(nColIndex).Columnorder=1
    	  nodefault
	      .Panel = 1
	      .Columns(.Columncount).Setfocus()
	    endif 
    Endif
    If .Panel = 1 and .Columns(nColIndex).Columnorder=thisform.lockcount+1
    	nodefault
      .Panel = 0
      .Columns(thisform.lockcount).Setfocus()
    Endif
  Otherwise
  Endcase
Endwith
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform