Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid Problem
Message
From
07/02/2002 10:16:51
 
 
To
07/02/2002 09:46:02
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00615913
Message ID:
00616618
Views:
27
Thanks, the key thing was 'nodeafault' in BRCC and doscroll() use in ARCC.
Anyway, even this sample looks quite cumbersome. Grid is jumping during doscroll's and selecting cells other then in close record.

I stopped on the solution with tablerevert(.F.) in BRCC instead of DELETE and table buffering. Much simpler, no jumping of grid at all and no need to use NODEFAULT - user can click by mouse on any cell far up from the last new empty record, and get into that cell ok without any jumping.

Thanks anyway.

>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?
>>
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Reply
Map
View

Click here to load this message in the networking platform