locked
Hot to prevent a grid from refreshing. RRS feed

  • Question

  • I have a grid in a multi user environment.

    Is there a way to prevent the grid from refreshing when the user clicks on it?

    Details:

    User 1 is in process of changing some information through a grid. The grid's recordsource is a small shared table with a filter - not a cursor.

    other users can add records to this table. When that happens, and the first user clicks the grid, things change, and records are added, and this is confusing.

    Thanks!

    Tuesday, June 23, 2020 4:07 PM

Answers

  • How should that work?

    Using buffering you could prevent saving changes to the DBF. But then you don't only prevent seeing new data and changes of others, you never save changes at all, and that can't be the goal.

    If you insist on the DBF binding, you'd need to apply a filter that doesn't match new records of others and only lets you see your own. So records would need to have some fields you can filter by, a user id, a timestamp, whatever.

    On the other hand there is a very usual way to cover a session of a business case to one user as retrieving data with an updatable view or cursoradapter. Then work on that data. Then you have your own separate part of the DBF as queried at form or search start.

    So in short, just do like the rest of the world and let each user have it's own data session populated with data from a server at the start of an editing session. Views or cursoradapters don't refresh unless you actively do requery them. And in the usual case you would never.

    I don't know if that really covers your case. Take ideas as you see them in the world. Amazon allows you to edit your order, but only until someone starts to process it (obviously). 

    Bye, Olaf.

    • Edited by OlafDoschke Tuesday, June 23, 2020 7:34 PM
    • Marked as answer by Aleniko2 Wednesday, June 24, 2020 3:14 AM
    Tuesday, June 23, 2020 7:02 PM

All replies

  • If you're using shared table, then I think it's an expected behavior. If you want some static information, you may want to use a cursor. Also, most of the people advise to not do direct editing in the grid but rather in the separate form and have the grid only for display.

    For every expert, there is an equal and opposite expert. - Becker's Law


    My blog


    My TechNet articles

    Tuesday, June 23, 2020 4:18 PM
  • How should that work?

    Using buffering you could prevent saving changes to the DBF. But then you don't only prevent seeing new data and changes of others, you never save changes at all, and that can't be the goal.

    If you insist on the DBF binding, you'd need to apply a filter that doesn't match new records of others and only lets you see your own. So records would need to have some fields you can filter by, a user id, a timestamp, whatever.

    On the other hand there is a very usual way to cover a session of a business case to one user as retrieving data with an updatable view or cursoradapter. Then work on that data. Then you have your own separate part of the DBF as queried at form or search start.

    So in short, just do like the rest of the world and let each user have it's own data session populated with data from a server at the start of an editing session. Views or cursoradapters don't refresh unless you actively do requery them. And in the usual case you would never.

    I don't know if that really covers your case. Take ideas as you see them in the world. Amazon allows you to edit your order, but only until someone starts to process it (obviously). 

    Bye, Olaf.

    • Edited by OlafDoschke Tuesday, June 23, 2020 7:34 PM
    • Marked as answer by Aleniko2 Wednesday, June 24, 2020 3:14 AM
    Tuesday, June 23, 2020 7:02 PM
  • Thanks!
    Wednesday, June 24, 2020 3:15 AM