Use CSS to replace the header text with an image (most common)
Data Grid 2 headers have predictable CSS classes, so you can target a specific column header and inject a background image.
Steps
Give your Data Grid 2 a class name (e.g. logo-header-grid)
Add this to your theme’s custom.scss
.logo-header-grid .th[data-field="MyColumn"] { background-image: url('/img/logo.png'); background-repeat: no-repeat; background-position: center; background-size: contain; color: transparent; // hides text }
MyColumn = the attribute name of the column
Hi,
Right now, Data Grid 2 doesn’t really let you put images or custom widgets into column headers. Headers are basically text only, so there’s no built-in way to swap the label for a logo or an image.
What you can do instead:
Use a simple layout workaround: Put a logo or icon in a container above the grid and line it up visually with the column. You would have lost the filtering and sorting features that belong to the dataGrid2.
Go custom: If you really need full control over header content, the only real solution is a custom grid widget that supports custom headers.
Hopefully this helps you.