BUG with GRID This.CellColIndex ?

Discuss anything else that does not suite other forums.

Moderator: Rathinagiri

Post Reply
User avatar
AUGE_OHR
Posts: 2061
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

BUG with GRID This.CellColIndex ?

Post by AUGE_OHR »

hi,

i got a BUG when using This.CellColIndex in a GRID this Way

Code: Select all

PROCEDURE Data2Array(...)
LOCAL aClickHead := {}

   bClickHead := { || SetEndCol( aNew, @iMax ) }
   FOR j := 1 TO jMax   // every Column
      AADD( aBackColor, bBackColor )
      AADD( aForeColor, bForeColor )
      AADD( aClickHead, bClickHead )
   NEXT

   @ 50, 10 GRID Grid_1 ;
      ... 
      DYNAMICBACKCOLOR aBackColor ;
      DYNAMICFORECOLOR aForeColor ;
      ON HEADCLICK aClickHead
this Code is to show in which Column i click in Header but it is Col+1 :!:
so 1st Col give me 2 ... only Last is right

Code: Select all

STATIC PROCEDURE SetEndCol( aNew, nInOut )
LOCAL nCol := This.CellColIndex
LOCAL iMax := LEN( aNew[1] )
   IF nCol <= iMax
      nInOut := nCol
      MsgInfo( "End Col : " +;
                LTRIM( STR( nCol ) ) + " of " + ;
                LTRIM( STR( iMax ) ) )
   ENDIF
RETURN
can someone confirm this BUG ?
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2061
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: BUG with GRID This.CellColIndex ?

Post by AUGE_OHR »

hi,

i have made a Demo to show the BUG of This.CellColIndex in a GRID
viewtopic.php?f=12&t=6272
have fun
Jimmy
Post Reply