Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid does not refresh after adding empty row
Message
De
03/03/2003 05:21:45
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
02/03/2003 08:32:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00743140
Message ID:
00760282
Vues:
13
>>>>>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, I tried those suggestions without success.
>Now I created a simple repro in message #760102 for you which
>I hope is easier to follow.
>
>How to refresh grid without losing all control sources and column settings ?

Andrus,
As I replied to that message problem is in 'DeleteRow' method. Use go recno() to force a refresh (grid.refresh doesn't do the job).
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