Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid ActiveRow always returns 0
Message
From
15/05/2004 05:29:40
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00904000
Message ID:
00904292
Views:
23
David,

I don't like the idea of deleting a record that is not highlighted, so the deletebutton is not enabled unless there is a lit row. Also, set deleted is off, therefore visible until saved, and deleted records are in different color. I purposely choose not to to use the delete-mark.

I know it's designed that way, that's exactly what I'm bitching about <g>

I mean, what's the point of the grid having the focus? Please correct me if I'm wrong, but if one's moving around in it or editing, it's always a cell that, i.e. a textbox, checkbox or whatever, that has the focus, right?

Anyway, I finally got it to work.
* Grid.AfterRowColChange
THIS.nActiveRow = THIS.ACTIVEROW

* DeleteButton.Click
THIS.PARENT._grid1.SETFOCUS     

* Quite weird behaviour here
* No code in SetFocus, so why does Pageframe.Page2.Activate fire?

IF THIS.PARENT._grid1.nActiveRow <> 0
   SELECT SoSInvoice
   DELETE
   THIS.PARENT._grid1.REFRESH
ENDIF
Thank's for your help, all of you.

BR

Peter


>Peter,
>
>Why don't you simply delete the record?
>
>
>delete in TheAlias
>skip 1 && move record pointer, and you'll want to add eof()/bof() testing as required
>this.parent.Refresh()
>
>
>>Why the grid has to have the focus in order to determine the activerow is quite beyond me, but that's another matter.
>
>That's the way it's designed, ActiveRow only has a value while the grid is the active control (ie has focus).
Peter Pirker


Whosoever shall not fall by the sword or by famine, shall fall by pestilence, so why bother shaving?

(Woody Allen)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform