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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

How to select multiple rows programmatically in Grid

(0) ShareShare
ReportReport
Posted on by
I want to select a number of rows in a grid programmatically applying some conditions. The rows supposed to be pre-selected. However, I can't find any method to perform this operation. Here is my function as follows.
 
function formatZIPCodeDecimalFromSubgridField1(executionContext) {    var formContext = executionContext.getFormContext();    debugger;    var tabName = /tab_Settings/;    var tabControl = formContext.ui.tabs.get(tabName);    if (tabControl.getVisible()) {              var subgridControl = tabControl.sections.get(/tab_4_section_3/).controls.get(/Subgrid_new_2/);        subgridControl.refresh();        setTimeout(function () {                      var selectedRecords = subgridControl.getGrid().getRows();            selectedRecords.forEach(function (record) {                var fieldName = /code/;                var fieldValue = record.getData().getEntity().attributes.get(fieldName).getValue();                if (fieldValue !== null) {var rowId = record.getData().getEntity().getId();//subgridControl.SelectRow(1);                    //subgridControl.getGrid().setSelection(rowId, true);                                   }            });        }, 1000);    }}
 
I have the same question (0)
  • Leah Ju Profile Picture
    Microsoft Employee on at
    Hi Partner,
    Do you mean that such a tick action is implemented via js code?
    Based on current documentation, there is currently no method to achieve this.
  • Pradeep Rai Profile Picture
    5,489 Moderator on at
    Hi,

    Why you want to pre-select the rows because if you are writing the javascript then you can get those records using retrieve multiple API call.

    Also, we do not have any method currently to select.

    if you want the functionality then you can try the PCF control. but this will be time consuming.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
11manish Profile Picture

11manish 178

#2
ManoVerse Profile Picture

ManoVerse 149 Super User 2026 Season 1

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 57 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans