Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DeleteMark question! Help me
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00448345
Message ID:
00448356
Views:
19
>Hi all,
>
> I have a parent-child form with a grid. when I mark any record for deletion, it only sets focus on 1st record (on grid). For example, I have 3 records in the grid. I want to be able to delete the 3rd record only, but the first time when I mark on the deletemark(the left-hand side of the grid) It sets focus to the 1st record on the grid.
>
>Is there any command or method event that allows me to get exact record marked on the grid?
>
>Any suggestions would be great help. Thank you in advance!

I have the followiong code in the DELETED method of my grid class:
LPARAMETERS nRecNo
local lcRecordSource, lnSelect
lcRecordSource = This.RecordSource
lnSelect = select()
select (lcRecordSource)
if This.RecordSourceType < 2
   goto record nRecNo
   This.SetFocus()
   if This.lDeleteWarning  && custom property of my grid class
      local lnRetVal
      lnRetVal = MessageBox("Please confirm -- DELETE Current Record?", MB_ICONQUESTION + MB_YESNO + MB_DEFBUTTON2, "Warning!")
      if lnRetVal <> IDYES
         nodefault
         return 0
      endif
   endif
   goto record nRecNo
   ThisForm.LockScreen = .t.
   delete next 1
   skip -1
   if bof()
      locate
   endif
   if !eof()
      nRecNo = RecNo()
      locate
      This.Refresh()
      This.SetFocus()
      goto nRecNo
   endif
   This.Refresh()
   ThisForm.LockScreen = .f.
endif
NoDefault
select (lnSelect)
Return
Mark McCasland
Midlothian, TX USA
Previous
Reply
Map
View

Click here to load this message in the networking platform