Hi All,
I have a grid on a form and when I press CTRL+N,I want the record to be inserted at the end of the grid but it goes back to the first record and insert the new record at the second position.
Then I wrote datasource_ds.last(); in create method of the datasource,so now when I press CTRL+N ,it inserts the record at the end of the grid first and then again if I press CTRL+N ,it inserts at the second row.
Hence first it inserts at end and then it inserts at second row position.
I am not sure how to fix this.
Also,insertatend property is yes.
*This post is locked for comments
Hi Roshni,
1.Data source InsertAtEnd property. You have already mentioned that you are Yes.
2.When you currently add a new record, move the selected row of the cursor and add it again. Does the adding order change?
I simply created a form and added data sources.
My solution:
Override the create() method in your datasource.
public void create(boolean _append = true) { this.last(); super(_append); }
Actually there's a property called InsertAtEnd in the data source. Set that to yes.
Hi Roshni
On the datasource that your grid uses, there is a property called StartPosition. Change it to 'Last'.
That means that all of the newest records will appear at the bottom, and the oldest ones at the top.
You don't need any code for this requirement.
Hope this helps
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,188 Super User 2024 Season 2
Martin Dráb 230,030 Most Valuable Professional
nmaenpaa 101,156