Hyperlink Column

B

Bishoy George

I have 2 columns in a Table in SQL database called LinkName , LinkURL.
I put the 2 columns in a table in a dataset

How to display the 2 columns in a datagrid as ONE column displaying the
LinkName column and when the user clicks on the link name item it directs
the user to its link url.

Thanks.
 
A

Ahmed Fouad

<asp:DataGrid id="MyDataGrid"
BorderColor="black"
BorderWidth="1"
GridLines="Both"
AutoGenerateColumns="false"
runat="server">

<HeaderStyle BackColor="#aaaadd"/>

<Columns>

<asp:HyperLinkColumn
HeaderText="Click an Item"
DataTextField="LinkName"
DataNavigateUrlField="LinkUrl" />

</Columns>

</asp:DataGrid>
 

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,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top