Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Is there any way to disable some rows of the detail grid on the form?

(0) ShareShare
ReportReport
Posted on by 85

In this scenario, i have many rows in the grid and data source for the gird is regular table. I want to disable few rows from the grid based on some value.

Is there any solution?

*This post is locked for comments

  • Martin Dráb Profile Picture
    Martin Dráb 231,409 Most Valuable Professional on at
    RE: Is there any way to disable some rows of the detail grid on the form?

    Please don't forget to close the thread by marking the verified answer(s).

  • RE: Is there any way to disable some rows of the detail grid on the form?

    I got it thanks a lot.

  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 231,409 Most Valuable Professional on at
    RE: Is there any way to disable some rows of the detail grid on the form?

    It's set for the active line. So when you switch to another line, active() method is called again, your logic gets re-evaluated and you set the new active line as writable or read-only.

    By the way, if you want to disable all fields, don't bother setting them up individually. Call allowEdit() method of the whole datasource.

    You'll find plenty of examples in standard forms.

  • RE: Is there any way to disable some rows of the detail grid on the form?

    I tried this but it makes complete column read-only.

    ABC_ds.object(fieldNum(Table, field)).allowEdit(fales);

    What i want to do is make some the rows read-only, e.g. if i have 5 rows in the grid, i want to make 2 of 5 rows ready only.

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 231,409 Most Valuable Professional on at
    RE: Is there any way to disable some rows of the detail grid on the form?

    Override active() method of your form datasource. There evaluate your logic and set AllowEdit property of the datasource to true or false (by calling its aloowEdit() method).

  • RE: Is there any way to disable some rows of the detail grid on the form?

    Making them read-only.

  • Martin Dráb Profile Picture
    Martin Dráb 231,409 Most Valuable Professional on at
    RE: Is there any way to disable some rows of the detail grid on the form?

    What do you mean by "to disable rows"? Hiding them? Making them read-only?

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February 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... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans