Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid does not refresh after adding empty row
Message
From
22/01/2003 06:20:23
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
21/01/2003 14:27:09
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00743140
Message ID:
00744169
Views:
13
>>>I have found that grid dows not show added row in some case, if
>>>grid is empty.
>>>I preparead a sample about this at www.eetasoft.ee/gridnotrefreshed.zip
>>>
>>>1. Unpack files to some directory
>>>
>>>2. Run VFP 7 IDE
>>>
>>>3. SET DEFAULT TO the directory where you unzipped files.
>>>
>>>4. DO MAIN
>>>
>>>
>>>Result observed:
>>>
>>>Empty grid
>>>
>>>
>>>Result expected:
>>>
>>>Line with word Hello in first column in grid.
>>>Press Ctrl+Tab in grid to see expected result.
>>>
>>>Any ides how to force grid to refresh in this case ?
>>>
>>>I tried refresh, wait window timeout, doevents, acti window/deactivate window nut this does not help.
>>>
>>>Any ides how to fix this ?
>>>
>>>my row adding method contains the code:
>>>
>>>
>>>sele (thisform.brtabel)
>>>append blank
>>>REPLACE klient WITH 'hello'
>>>unlock
>>>thisform.gridbase1.setfocus()
>>>thisform.boundcontrolinteractivechange()
>>>
>>
>>
*...
>>unlock
>>with thisform.GridBase1
>> .RecordSource = .RecordSource
>> .setfocus()
>>endwith
>>*...
>
>Cetin,
>
>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 ?

Andrus,
As Fred said it sounds like you're not getting recno() of intended alias.
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform