Hiding a Column Without Removing From a View in Model-Driven App

Linn Zaw WinDyn365CE2 years ago20 Views

Sometimes, there is a requirement to hide a column from a view (main grid or
subgrid view) even though the column is required for the view to be
functional. Since the column is still required, it cannot be removed using the
modern view designer.

One of the examples is to hide the column that is used for sorting because it
is showing up as a subtitle in the lookup dropdown because it is the 2nd
column of the lookup view.
Kailash Ramachandran
has
blogged about the solution
for such a problem by removing the column only in the LayoutXml with the
“Select Columns” option in the View Designer tool in XrmToolBox.

Another requirement with a similar problem is to hide the Path column in the
associated view of the SharePoint documents in the model-driven app (as
commented over here).

If the Path (relativelocation) column is removed from the view in the view
designer, the grid control is not able to render anymore.

As in the solution above, I tried to load the Document Associated Grid with
the View Designer tool in XrmToolBox but I was getting
NullReferenceException error and was unable to save the view. Since the tool
was last updated in 2016, there might be some issues with the new properties
introduced in the later version of the view schema.

Since View Designer tool is not working well with Document Associated
Grid, the only solution is to update the LayoutXml manually. To do so, create
a new solution, add the view into the solution, export and extract the
solution.zip file and edit the customizations.xml. In the XML file,
find the cell element for Path (with name=”relativelocation”) cell, replace
the width attribute with (ishidden=”1″) as in the screenshot below (or remove
the whole element).

That will hide the column from the view but it will still remain in the
<fetchxml> so that the grid control will still be functional.

Original Post http://linnzawwin.blogspot.com/2023/04/hiding-column-without-removing-from.html

0 Votes: 0 Upvotes, 0 Downvotes (0 Points)

Leave a reply

Top Headlines
    Join Us
    • X Network2.1K
    • LinkedIn3.8k
    • Bluesky0.5K
    Support The Site
    Events
    June 2025
    MTWTFSS
           1
    2 3 4 5 6 7 8
    9 10 11 12 13 14 15
    16 17 18 19 20 21 22
    23 24 25 26 27 28 29
    30       
    « May   Jul »
    Follow
    Sign In/Sign Up Sidebar Search
    Loading

    Signing-in 3 seconds...

    Signing-up 3 seconds...