Display Dynamic hyperlink in the Datagrid

  • Thread starter Roopashree BR via .NET 247
  • Start date
R

Roopashree BR via .NET 247

I have a datagrid which is populated with the values from the database and has a column named Description. According to value of Description, the text of the Description is to be changed to hyperlink.
eg. If its value is XX --- then display hyperlink for this value alone in the column
Elseif its value is YY --- then display normal label or text.

Is there any other way than using Datagrid to accomplish above.
 
M

Michael Tkachev

<asp:TemplateColumn>
<ItemTemplate>
<asp:LinkButton Runat="server" Visible='<%#
(Convert.ToInt32(DataBinder.Eval(Container.DataItem, "Size")) ==
2)?true:false%>'>Bla-bla</asp:LinkButton>
<asp:Label Runat="server" Visible='<%#
(Convert.ToInt32(DataBinder.Eval(Container.DataItem, "Size")) !=
2)?true:false%>' ID="Linkbutton1">Bla-bla</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>

Roopashree BR via .NET 247 said:
I have a datagrid which is populated with the values from the database and
has a column named Description. According to value of Description, the text
of the Description is to be changed to hyperlink.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top