Skip to main content

Notifications

Dynamics 365 Community / Forums / Finance forum / Keep line selection on...
Finance forum
Answered

Keep line selection on grid after update

Posted on by 348
Hi all,

I have created a form with 2 grids.

Each grid is feeded by it own datasource.

When i select a line on the first grid1, the second Grid2 is filtered based on grid1 line value.

Then on the second grid i'm using a checkbox control, i linked it to a modified method.

When modified method is used, the selected line from grid1 will be updated.

What i need now it's to keep highlighted the first selected line on Grid1, how to reach that ?

Thanksfully.
  • Awaxx Profile Picture
    Awaxx 348 on at
    Keep line selection on grid after update
    I tried before your answer this way but if i add in this modified method this code i will avoid the selection of the line i did and the selection will go up to the first line.
  • Suggested answer
    Waed Ayyad Profile Picture
    Waed Ayyad 3,332 on at
    Keep line selection on grid after update
    Hi,
     
    Try to add this line also:
     
    YourParentTable_DS.research(true);
     
    Thanks,
    Waed Ayyad
    If this helped, please mark it as "Verified" for others facing the same issue
  • Awaxx Profile Picture
    Awaxx 348 on at
    Keep line selection on grid after update
    Hi,

    When i achieve the first part i describe on the initial post, i need to go back to the caller form. There i'm using the same table as datasource i ve got updated before. What i need now is to refresh the displayed data.

    Thanks
  • Waed Ayyad Profile Picture
    Waed Ayyad 3,332 on at
    Keep line selection on grid after update
    Hi,
     
    I'm glad your question is resolved, for your next question, what is the parent form? do you mean you have for example list page (caller form)? What do you want to achieve on the caller form? I need more details in order to help you.
     
    Thanks,
    Waed Ayyad
     
     
     
  • Awaxx Profile Picture
    Awaxx 348 on at
    Keep line selection on grid after update
    Thank you it's working.

    If i have to refresh the parent (callerform) form should i write it here too or where else ?!!!!!!

    Thanks.
  • Verified answer
    Waed Ayyad Profile Picture
    Waed Ayyad 3,332 on at
    Keep line selection on grid after update
    Hi,
     
    Do you mean that the selected line return to first record on the Grid1? if yes then try to call reread(), rereadreferencedatasource(), research(true), on your grid2 data source:
    YourTable_DS.reread();
    YourTable_DS.rereadReferenceDataSources();
    YourTable_DS.research(true);
     
    Thanks,
    Waed Ayyad
    If this helped, please mark it as "Verified" for others facing the same issue
     
  • Awaxx Profile Picture
    Awaxx 348 on at
    Keep line selection on grid after update
    Hello, 

    Someone for some help please ?

     

Helpful resources

Quick Links

Community Spotlight of the Month

Kudos to Mohamed Amine Mahmoudi!

Blog subscriptions now enabled!

Follow your favorite blogs

TechTalk: How Dataverse and Microsoft Fabric powers ...

Explore the latest advancements in data export and integration within ...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 284,753 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,302 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,146

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans