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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Editable grid - Hide Column in Editable grid

(0) ShareShare
ReportReport
Posted on by 10

Hi,

I need sorting on records in editable grid on created on field so added created on field in view, but as client requirement is not to show that column in the grid.

I handled onload event of  editable grid , But in that I don't get the controls for created on cell.

controls value is null.

Please suggest the solution to hide created on column in Editable grid.

I am trying below code on Grid Onload.

var scRows = Xrm.Page.getControl("grd_Test").getGrid().getRows();

if (scRows != null && scRows !== "undefined") {

scRows.forEach(
function (scRow, i) {

var scControls = scRow.getData().getEntity().attributes.getByName("createdon").controls;

if (scControls != null && scControls !== "undefined") {
scControls.forEach(
function (ctl, j) {

ctl.setVisible(false);
});
});

Thanks,

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    prt33k Profile Picture
    6,907 on at

    Hi Savita,

    It is not possible to hide column in editable grid - you can disable it but that wont help in your case.

    Sorted column need to be present in grid/view since CRM also provide facility to change order of sorting by clicking the field.

    Any specific reason you are trying to hide it?

    Thanks,

    Prateek

  • Savita Profile Picture
    10 on at

    Thanks Prateek !!,

    Client don't want  to see that field value, that's it. I am Ok even if  I can make it visible false and column exists there.

    And also to setDisabled I need to get control of that cell, But no Luck. On Onload event  I get Controls = null

    if any other event I can Handle?

    Thanks,

  • Verified answer
    ashlega Profile Picture
    34,477 on at

    Hi Savita,

     you might try updating the view "manually" - add that entity (and the view) to a new solution, export it, open customizations.xml, find the view, add orderby, re-package the solution, and import it back.

  • Suggested answer
    prt33k Profile Picture
    6,907 on at

    Hi Savita,

    You can try Alex suggestion - basically changing the sort field in customization.xml for the view linked to editable grid.

    The other way will be to write plugin on RetrieveMultiple and on pre event modify the query by adding sorted by criteria.

    Though it is a overkill for sure so wont recommend.

    Thanks,

    Prateek

  • Suggested answer
    Savita Profile Picture
    10 on at

    Thanks Alex,

    This worked for Me.

    Thanks,

    Savita M.

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 CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans