Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid does not refresh after adding empty row
Message
De
08/02/2003 02:55:08
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
02/02/2003 06:50:08
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00743140
Message ID:
00750981
Vues:
17
>>>I found that adding this line loses current row in grid:
>>>first row becomes current row always.
>>>I added the recno() save and restore:
>>>
>>>
>>>nr = RECNO()
>>>with thisform.GridBase1
>>> .RecordSource = .RecordSource
>>> .setfocus()
>>>endwith
>>>BROWSE TITLE TRANSFORM(nr) FIELDS rno=RECNO()
>>>GO (nr)
>>>
>>>
>>>I got an error "Record is out of range" in the
>>>GO (nr) line.
>>>
>>>BROWSE command shows -1 in title and also shows that a record having recno() -1 exists.
>>>
>>>Any ideas why GO (nr) fails ?
>>
>>As Fred said it sounds like you're not getting recno() of intended alias.
>
>Cetin,
>
>I tried the following code:
>
>
>LOCAL nRecno
>nRecno  = RECNO('mitteakt')
>WITH _screen.Activeform.gridbase1
>  * this causes a row to appear in grid:
>  .recordsource = .recordsource
>ENDWITH
>SELECT mitteakt
>
>* this works but I caanot use this since tables are large and
>* this takes a lot of time :
>LOCATE FOR RECNO()=-1
>
>* This causes error record is out of range !
>GO (m.nRecno) in mitteakt
>
>
>Why the GO (m.nRecno) in mitteakt fails ?
>
>How to replace this LOCATE command with faster command in large tables without indexes ?

Andrus,
Your code as I remember was some wizard code very hard to follow.
Why would you try to go recno() you're already on. Possibly in your code there is something causing a commit and making recno() positive (row buffered and rec pointer move causing implicit update ?). If -1 is nonexistant then all is committed. Try :
go reccount('mitteakt') in 'mitteakt'

Also possibly locate for recno()=-1 is actually failing and going to eof(). Grid gets you back to last record.
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