Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

My Grid Refresh

Status
Not open for further replies.

jerold

Programmer
Aug 30, 2000
52
PH
I have this form1. It has grid1 that uses table1 as control source.Grid1's allowaddnew = .f.

In the form1>data environment>code I have this line
use table1
=cursorsetprop("Buffering",5,"table1")

I have cmdAdd on form1.This button has this code...
sele table1
append blank

Problem: when I click on the grid1, there is no new/blank
reocrd appended.

I tried to issue refresh on form1, refresh on grid1
but still I cant see any changes.

Please help me on how to go about this problem.

thank you:)
[sig][/sig]
 
Suha

I have cmdAdd on form1.This button has this code...
sele table1
[tab]TABLEUPDATE(.T.,.T.,[TABLE1])
append blank

You are not writing the changes to your table.

Chris

[sig][/sig]
 
SetFocus to your grid after APPEND BLANK. ThisForm.grdMyGridName.SetFocus(). I differ from Chris putting table update code, forced or unforced to a Add command button. JMO [sig]<p>John Durbin<br><a href=mailto: john@johndurbin.com> john@johndurbin.com</a><br>MCP Visual FoxPro<br>
ICQ VFP ActiveList #73897253[/sig]
 
John

I would not do it that way either.

I was showing Jerold what was missing rather than trying to show the best way to do it, and should have qualified the post.

Chris [sig][/sig]
 
Chris, Jerold uses 5 buffering mode, that obvious supposed to add a lot new records that are buffered ;)
Jerold, if you allow to edit data in grid, you probably should set focus to grid AND to required starting column anyway. Following lines will guarantee correct refresh:
MyGrid.Refresh()
MyGrid.Column1.SetFocus()
MyGrid.Refresh()
If your grid is read-only, than set focus to grid, refresh it, set focus to the first control you use to enter new data.

Hope this helped. [sig]<p>Vlad Grynchyshyn<br><a href=mailto:vgryn@softserve.lviv.ua>vgryn@softserve.lviv.ua</a><br>[/sig]
 
Jerold, are you certain that the record is not there, rather than it being there, but scrolled off (not visible) in the grid? IOW, if you scroll around in the grid, will you run across the new, blank record at the bottom? [sig]<p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br> [/sig]
 
Vlad

Chris, Jerold uses 5 buffering mode, that obvious supposed to add a lot new records that are buffered ;).

It is not obvious that Jerold will be adding a lot of new records by his use of 5 buffering mode.

It would appear that Jerold is not too comfortable with the use of CURSORSETPROP() and TABLEUPDATE(), hence his request for help, therefore it would probably be wrong to read too much significance into the buffering mode.

I would not do it that way either.

If asked, I would advise Jerold to add data through a dedicated data entry form using appropriate labels, validated textboxes with ToolTipTexts, combo boxes for restricted selection if applicable, etc, etc which would be far more intuititive and user friendly than using a grid.

The grid could be visible on the underlying form and be refreshed by events on the data entry form.

However the important thing for Jerold is that if he is happy adding data through a grid and it works for him, then he has a solution.

Chris



[sig][/sig]
 
... hence his request for help, therefore it would probably be wrong to read too much significance into the buffering mode

Correct. Sorry.

However the important thing for Jerold is that if he is happy adding data through a grid and it works for him, then he has a solution.

I built application where most data forms were grids instead of usual set of controls and navigation toolbar. It was quite a mess to work with controls in grid (I made my own column and header classes), but it worked great. Invoise entry form was grid, that is the most appropriate - to see information in the form like you see it on the paper. Customer looked how invoise form works and wanted to make the same grids for other data forms.
As you see, this mostly depended on customer and type of application, but not on the way prgrammer want.
[sig]<p>Vlad Grynchyshyn<br><a href=mailto:vgryn@softserve.lviv.ua>vgryn@softserve.lviv.ua</a><br>[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top