web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Inserting the record at the end of the grid

(0) ShareShare
ReportReport
Posted on by

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

I have the same question (0)
  • Suggested answer
    BrandonSA Profile Picture
    1,673 on at
    RE: Inserting the record at the end of the grid

    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

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: Inserting the record at the end of the grid

    Actually there's a property called InsertAtEnd in the data source. Set that to yes.

  • Blue Wang Profile Picture
    on at
    RE: Inserting the record at the end of the grid

    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);
    }


Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 3

#3
Scott_itD Profile Picture

Scott_itD 2 Community Manager

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans