Search code examples
kentico

Is there a way to display new column in Orders html table in Kentico without touching the code?


I'm using Kentico MVC v12 with a fresh installation of DancingGoat(MVC) template.

I've modified the "E-commerce" module by adding a new column in the "Order" table. enter image description here

I would like to be able to see it on the "Order" module in the list page. enter image description here

I see in the "User interface" tab that it uses an "aspx" page. enter image description here

In it I see that it calls an "ascx" page that uses a "UniGrid" component and specify the columns directly in a data attribute. enter image description here

I don't like the idea to modify this file to display my new column because I see this website as the foundation of my next features, I would like to avoid as much as possible to touch the code of the website template, do you know if there is an other way ?

Maybe I'm missing a configuration somewhere else ?

Thank you by advance !

Update 06-03-2019: I tried the solution of Peter Mogilnitski but it doesn't work :x

I added the column in the data source enter image description here

Then I checked the column in widget configuration enter image description here

Nothing is displayed enter image description here

I debugged the sql query, I don't see my column in the query, is there an other configuration to do somewhere else ? enter image description here

Update 08-03-2019:

The support of Kentico confirmed that the solution I proposed that was confirmed by @Rui was the right way to do it.

Thank you everyone !


Solution

  • If you want the custom field to appear in the UI, you will have to make change to the ascx page. You will need to make a note to that because you will likely need to update it during upgrade or hotfix (less likely)

    Other than adding the data field to Columns, you will also need to add ug:column to the section

    <ug:Column Name="SAPID" Source="SAPID" Caption="SAPID" Sort="SAPID" />