Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid Problem
Message
De
07/02/2002 09:46:02
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00615913
Message ID:
00616587
Vues:
24
Vlad,
Below code worked for me.
PS:Actually I use Ctrl+DownArrow for addnew to control it by myself.
*BRCC
Lparameters nColIndex
With this
  If mdown()
    lnBottom		= .top+.headerheight+.relativerow * .rowheight
    lnTop		= lnBottom - this.rowheight
    lnMouseRowPos	= mrow(wontop(),3)
    lnMouseColPos	= mcol(wontop(),3)
    llChangingRow	= !(between(lnMouseRowPos,lnTop, lnBottom) ;
      and between(lnMouseColPos,.left,.left+.width))
  Else
    llChangingRow	= inlist(lastkey(),24,5,18,3,145,148)
  Endif
*llIsRecEmpty = SomeCheck()
  If llChangingRow and llIsRecEmpty
      nodefault
      If lastkey()=5
        Delete
        Go bottom
        .tag = 'Scroll'
      Endif
  Endif
Endwith

*ARCC
Lparameters nColIndex
with this
  If !empty(.tag)
    .Tag = ''
    .doscroll(2)
    .doscroll(3)
  Endif
  .refresh()
endwith
Cetin

>Hi!
>
>Hmm, I tried this and many other approaches and it did not worked.
>
>What I'm going to do is a simple form with grid with AllowAddNew=.T. When user add new record, then add again, previous empty record should be deleted. When use moves out of new record, it shoul dbe deleted too. So, it will look like only one empty record could be edited at that moment. I'm doing DELETE in BeforeRowColChange after checking if record is empty. Tried refreshing of grid in both events Before- and AfterRowColChange. You can easy re-create all this on a simple form. While records deleted are removed from grid displaying ok when they're not at the end of the grid, all ok. The last record do not want to be removed whatever I tried.
>
>I can try also a buffering and tablerevert() only for one record instead of DELETE command, but I though DELETE would be more simple for programming. Unfortunately, it does not works. It looks like grid holds that deleted record for some reason till grid is destroyed and created again.
>
>Any ideas?
>
Ç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