Try to use this below solution. Create separate file to apply link content before prepare datasource of ui grid. If you want to convert your rendering value into html along with cells html, then you need to add <item name="bodyTmpl" xsi:type="string">ui/grid/cells/html</item> inside your column item :
<column name="productname" class="VendorName\ModuleName\Ui\Component\Listing\Column\ProductName">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="bodyTmpl" xsi:type="string">ui/grid/cells/html</item>
<item name="filter" xsi:type="string">text</item>
<item name="editor" xsi:type="array">
<item name="editorType" xsi:type="string">text</item>
<item name="validation" xsi:type="array">
<item name="required-entry" xsi:type="boolean">true</item>
</item>
</item>
<item name="label" xsi:type="string" translate="true">Product Name</item>
</item>
</argument>
</column>
Create file at VendorName\ModuleName\Ui\Component\Listing\Column\ProductName.php :
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace VendorName\ModuleName\Ui\Component\Listing\Column;
use Magento\Ui\Component\Listing\Columns\Column;
use Magento\Framework\UrlInterface;
class ProductName extends Column {
protected $_productFactory;
protected $_urlBuilder;
public function __construct(
....
\Magento\Catalog\Model\ProductFactory $productFactory,
UrlInterface $urlBuilder,
\Magento\Framework\View\Element\UiComponent\ContextInterface $context,
\Magento\Framework\View\Element\UiComponentFactory $uiComponentFactory,
array $components = [],
array $data = []
) {
....
$this->_urlBuilder = $urlBuilder;
$this->_productFactory = $productFactory;
parent::__construct($context, $uiComponentFactory, $components, $data);
....
}
public function prepareDataSource(array $dataSource) {
if (isset($dataSource['data']['items'])) {
foreach ($dataSource['data']['items'] as $key => $items) {
$product = $this->_productFactory->create()->load(1);
$product_name = html_entity_decode('<a href="' . $this->_urlBuilder->getUrl($product->getProductUrl()) . '">' . $items['title'] . '</a>');
$dataSource['data']['items'][$key]['productname'] = $product_name;
}
}
return $dataSource;
}
}
UPDATE :
You can set your product url in href attribute. If you don't have product url then you need to get it and then use this below code :
public function prepareDataSource(array $dataSource) {
if (isset($dataSource['data']['items'])) {
foreach ($dataSource['data']['items'] as $key => $items) {
$product_name = [
'href' => your product URL,
'label' => __($items['productname'])
];
$dataSource['data']['items'][$key]['productname'] = $product_name;
}
}
return $dataSource;
}