Page 1 of 1

show GRID Row Number in Statusbar

Posted: Mon Jan 13, 2020 3:37 am
by AUGE_OHR
hi,

i like to show Row Number when move in GRID

Code: Select all

   @ 080, 010 GRID Grid_1 ;
      ...
      ON CHANGE ShowRow(LEN(aNew))

STATIC PROCEDURE ShowRow(iMax)
LOCAL cString := STR(This.CellRowIndex)+"/"+STR(iMax)
   Form_1.StatusBar.Item( 1 ) := cString
RETURN
but this work not stable :o
"This.CellRowIndex" show Number which does not match when using Keyboard up/down, how to fix it :?:

Re: show GRID Row Number in Statusbar

Posted: Tue Jan 14, 2020 5:15 am
by AUGE_OHR
hi

now i use

Code: Select all

LOCAL cString := STR( This.CellRowFocused ) + "/" + STR( iMax )
and this seems to work when scroll with Cursor in GRID

Re: show GRID Row Number in Statusbar

Posted: Tue Jan 14, 2020 12:47 pm
by mustafa
Hola AUGE_OHR (jimmy)
lo estoy presentando de esta forma desde el Label_2
I'm presenting it this way from Label_2

Code: Select all

   @ 080, 010 GRID Grid_1 ;
      ...
      ON CHANGE ShowRow()
 
   @ 485, 493 Label Label_2        ;   
                Width   080        ;
                Height  027        ;  
                FONT "Arial"  SIZE 10 BOLD  ;
                VALUE ""  
           
   END WINDOW
   
  Form_1.Center
  Form_1.Activate

Return Nil

*----------------------------------------------------------------------*
STATIC PROCEDURE ShowRow()   // NÂș de Registro / Total  
*----------------------------------------------------------------------*
 aReg    :=  Form_1.Grid_1.Value  
 nValor  :=  0
 Regs    :=  STR( Form_1.Grid_1.ItemCount )  
 
    Select 1
    nValor := aReg[1] 
    Form_1.Label_2.value := ALLTRIM( STR( nValor ) ) + SPACE(1) + "/" + SPACE(1) + ALLTRIM( Regs )  

Return Nil
View -------> viewtopic.php?f=5&t=6248&p=60476&hilit=mustafa#p60476
Sample ----> "Delete_Recall.zip"

Regards
Mustafa

Re: show GRID Row Number in Statusbar

Posted: Tue Jan 14, 2020 7:05 pm
by AUGE_OHR
hi,

Thx for Tip, i will have a look at it