show GRID Row Number in Statusbar

Discuss anything else that does not suite other forums.

Moderator: Rathinagiri

Post Reply
User avatar
AUGE_OHR
Posts: 458
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 49 times
Been thanked: 92 times

show GRID Row Number in Statusbar

Post by AUGE_OHR » Mon Jan 13, 2020 3:37 am

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 :?:
have fun
Jimmy

User avatar
AUGE_OHR
Posts: 458
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 49 times
Been thanked: 92 times

Post by AUGE_OHR » Tue Jan 14, 2020 5:15 am

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
have fun
Jimmy

User avatar
mustafa
Posts: 874
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Been thanked: 139 times
Contact:

Post by mustafa » Tue Jan 14, 2020 12:47 pm

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

User avatar
AUGE_OHR
Posts: 458
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 49 times
Been thanked: 92 times

Post by AUGE_OHR » Tue Jan 14, 2020 7:05 pm

hi,

Thx for Tip, i will have a look at it
have fun
Jimmy

Post Reply