---
title: Adding custom UniGrid transformations
related:
  - https://docs.kentico.com/13/custom-development/extending-the-administration-interface/ui-controls/unigrid.md
  - https://docs.kentico.com/13/custom-development/extending-the-administration-interface/ui-controls/unigrid/reference-unigrid-definition.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

The [UniGrid](https://docs.kentico.com/13/custom-development/extending-the-administration-interface/ui-controls/unigrid.md) provides built-in transformations for easy formatting of the content of columns. To learn about the UniGrid transformations that are available by default, see the description of the **externalsourcename** column attribute in [Reference - UniGrid definition](https://docs.kentico.com/13/custom-development/extending-the-administration-interface/ui-controls/unigrid/reference-unigrid-definition.md).

If you need to display column values in a custom format, you can register your own UniGrid transformations:

1. Open your administration project in Visual Studio.
2. Create a [custom module class](https://docs.kentico.com/13/custom-development/creating-custom-modules/initializing-modules-to-run-custom-code.md).
   - Add the class into a custom _Class Library_ project within the solution.
3. Override the module's **OnInit** method and and register your UniGrid transformations.
   - Call the **UniGridTransformations.Global.RegisterTransformation** method for each transformation.
4. Implement the methods that define the functionality of your custom UniGrid transformations.

> **Info:** For basic execution of initialization code, you only need to register a "code-only" module through the API. You do NOT need to create a new module within the **Modules** application in the Xperience administration interface.

```csharp title="Example"

using CMS;
using CMS.Base;
using CMS.DataEngine;
using CMS.UIControls;
using CMS.Helpers;
using CMS.PortalEngine;

// Registers the custom module into the system
[assembly: RegisterModule(typeof(CustomUniGridTransformationModule))]

public class CustomUniGridTransformationModule : Module
{
    // Module class constructor, the system registers the module under the name "CustomUniGridTransformations"
    public CustomUniGridTransformationModule()
        : base("CustomUniGridTransformations")
    {
    }

    // Contains initialization code that is executed when the application starts
    protected override void OnInit()
    {
        base.OnInit();

        // Registers the #customBoldText UniGrid transformation
        UniGridTransformations.Global.RegisterTransformation("#customBoldText", CustomBoldText);
    }

    // Method that defines the #customBoldText UniGrid transformation
    // Wraps the UniGrid column text value into a <strong> element
    private static object CustomBoldText(object parameter)
    {
        return "<strong>" + ValidationHelper.GetString(parameter, "") + "</strong>";
    }
}

```

Once a UniGrid transformation is registered, you can use it in the **externalsourcename** attribute of UniGrid columns.

```xml title="Example"

...

<GridColumns>
    <ug:Column Source="UserName" Caption="$general.username$" Width="100%" ExternalSourceName="#customBoldText" />
</GridColumns>

...

```
