Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Rearrange/Move grid column control layout

(0) ShareShare
ReportReport
Posted on by 15

Is there a way to change column position by X code?

I created one field in grid by code

formBuildGroupControl = element.form().design().control('Grid');
formBuildStringControl = formBuildGroupControl.addDataField(formBuildDataSource.id(), fieldNum(MyTable, MyField));
formBuildStringControl.name('ValueColumn');

adn the other one is created by AOT:

pastedimage1615987158519v1.png

My problem is that the "InvoiceAccount" field appears in the first place on the grid, and the field I created appears in the second place.
My goal is to find a way to move "InvoiceAccount" to the last place on the grid.

The last thing I would like to do is move the code, because I also work on standard code which also creates dynamic fields. The best solution for me would be to move this one field, instead of 5 dynamic fields.

I was looking for a solution to the problem in "FormBuildStringControl", unfortunately there is no method there that could help me.

  • ToddB Profile Picture
    on at
    RE: Rearrange/Move grid column control layout

    Hi Lukasz3,

    Are you able to move this with the New Grid Control ?

    New grid control

    docs.microsoft.com/.../dynamics365-release-pla

    n/2020wave2/finance-operations/finance-operations-crossapp-capabilities/new-grid-control--general-availability

    Grid capabilities

    docs.microsoft.com/.../grid-capabilities

  • Lukasz3 Profile Picture
    15 on at
    RE: Rearrange/Move grid column control layout

    To illustrate it more, I will put here an example picture and describe exactly what effect I plan to get

    pastedimage1616058889079v1.png

    "Customer Account" is a field created in AOT (image presented in my first message)
    "Project contract ID" is a field created by code (code presented in my first message)

    These two fields are lookup fields placed in the Financial dimension form, and I can't just drag them right or left.
    My goal is to do this:

     2021.03.18-10.12.13.925.png

    It looks so simple, but I can't find a way to achieve it. When I try to put code that creates the "Project contact ID" field after super() in form's init (because now it's in front of super() ), my application just crash without a message.
    I also tried to find an array that specifies the position of the fields in the grid, but there is no such table.

    Has anyone faced the same problem before me?

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,241 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,982 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans