All,
With this link below how to use gridview and merge the duplicate records https://www.aspsnippets.com/Articles/Implement-GridView-Grouping-Group-similar-GridView-Rows-in-ASPNet.aspx Thanks again
It's very helpful.
I applied the same code using Listview and it displays all hyperlinks as expected. You can view the screenshot of my Table DB and .aspx output.

As you can see from screenshot:
Using Gridivew: Fruit_Link displays 2 static values correctly but as soon as I use hyperlink it only displays 'Golden' value as a hyperlink. The correct output should be both 'Golden' hyperlink and 'Red' hyperlink.
Using ListView: Fruit_Link displays both 2 values correctly.
<asp:GridView ID="GridView1" runat="server" DataSourceID ="SQLDataSource1" AutoGenerateColumns="false" OnDataBound="OnDataBound">
<Columns>
<asp:BoundField DataField="Fruit_Name" HeaderText="Fruit_Name" SortExpression="Fruit_Name" />
<asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" />
<asp:BoundField DataField="Fruit_Link" HeaderText="Fruit_Link" SortExpression="Fruit_Link" />
<asp:TemplateField HeaderText ="Link">
<ItemTemplate>
<asp:Label Text='<% #Eval("Fruit_Color")%> ' Visible='<%# Convert.ToInt32(Eval("MD_ONLY")) <=0 ? false :true %>' runat ="server" />
<asp:HyperLink runat="server" ID ="h1"
NavigateUrl='<%# Eval("Fruit_Link", "~/{0}") %> '
Visible='<%# Convert.ToInt32(Eval("MD_ONLY")) <= 0 ? true : false %>' Text='<% #Eval("Fruit_Color") + "<br>"%>' Target="_xmlwindow">
</asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<h3>Using ListView</h3>
<asp:ListView runat="server" ID="ProductsListView" GroupItemCount="3" DataSourceID="SqlDataSource1" DataKeyNames="Fruit_Name">
<LayoutTemplate>
<table cellpadding="2" runat="server" id="tblProducts" style="height:320px"><tr runat="server" id="groupPlaceholder"></tr></table>
<asp:DataPager runat="server" ID="DataPager" PageSize="9"><Fields></Fields></asp:DataPager>
</LayoutTemplate>
<GroupTemplate> <tr runat="server" id="productRow" style="height:80px"> <td runat="server" id="itemPlaceholder"> </td> </tr></GroupTemplate>
<ItemTemplate>
<tr runat="server"> <td runat="server"> <asp:Label ID="NameLabel" runat="server" Text='<%#Eval("Fruit_Name") %>' /></td></tr>
</ItemTemplate>
<ItemTemplate>
<asp:Label Text='<% #Eval("Fruit_Color")%> ' Visible='<%# Convert.ToInt32(Eval("MD_ONLY")) <=0 ? false :true %>' runat ="server" />
<asp:HyperLink runat="server" ID ="h1"
NavigateUrl='<%# Eval("Fruit_Link", "~/{0}") %> '
Visible='<%# Convert.ToInt32(Eval("MD_ONLY")) <= 0 ? true : false %>' Text='<% #Eval("Fruit_Color") + "<br>"%>' Target="_xmlwindow">
</asp:HyperLink>
</ItemTemplate>
</asp:ListView>
<asp:SqlDataSource ID ="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:StringDev %>"
SelectCommand ="SELECT DISTINCT Fruit_Name, Description, Fruit_Color, MD_ONLY, Fruit_Link FROM Fruits WHERE Fruit_Name=@Fruit_Name">
<SelectParameters>
<asp:QueryStringParameter Name ="Fruit_Name" QueryStringField="Fruit_Name" />
</SelectParameters>
</asp:SqlDataSource>
protected void OnDataBound(object sender, EventArgs e)
{
for (int i = GridView1.Rows.Count - 1; i > 0; i--)
{
GridViewRow row = GridView1.Rows[i];
GridViewRow previousRow = GridView1.Rows[i - 1];
for (int j = 0; j < row.Cells.Count; j++)
{
if (row.Cells[j].Text == previousRow.Cells[j].Text)
{
if (previousRow.Cells[j].RowSpan == 0)
{
if (row.Cells[j].RowSpan == 0)
{
previousRow.Cells[j].RowSpan += 2;
}
else
{
previousRow.Cells[j].RowSpan = row.Cells[j].RowSpan + 1;
}
row.Cells[j].Visible = false;
}
}
}
}