i want the database column as hyperlinks in my gridview and navigateurl's to it plz need help asap.

Posted by kallamjreddy-17301 under ASP.NET on 8/10/2012 | Points: 10 | Views : 1479 | Status : [Member] | Replies : 2
hi there,

I need gridview columns as a hyperlinks in my grid view for example gmail inbox when i click on the subject i need to pop up seperate window to view the full mail.....

Could any one help me out with the code in c# ASAP.

Thanks in advance,


Posted by: Vikash on: 8/11/2012 [Member] Starter | Points: 25

your gridview in .aspx file


<asp:GridView ID="DataGrid1" HeaderStyle-CssClass="fixedHeader" EmptyDataText="No Matching Job Found"
runat="server" OnPageIndexChanged="datagrid_page" AllowPaging="True"
PageSize="20" AutoGenerateColumns="False"
Width="875px" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None"
BorderWidth="1px" CellPadding="3" GridLines="Horizontal" Font-Names="Verdana" Font-Size="Small"
<HeaderStyle BackColor="Gray" BorderColor="LavenderBlush" BorderStyle="None" Font-Bold="True"
Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False"
ForeColor="White" Borderwidth="1px" Font-Names="Verdana" Font-Size="Small" />
<RowStyle CssClass="rowstyle" BackColor="White" />

<asp:HyperLinkField DataNavigateUrlFields="CODE" DataNavigateUrlFormatString="jobdetail.aspx?code={0}" DataTextField="code" HeaderText="JOB CODE">
<ItemStyle BackColor="ActiveCaptionText" CssClass="" ForeColor="ControlDarkDark" HorizontalAlign="Center" />
<asp:BoundField DataField="location" HeaderText="LOCATION" >

<asp:TemplateField HeaderText="EXPERIENCE">

<ItemTemplate >
<asp:Label BackColor="ActiveCaptionText" ForeColor="ControlDarkDark" runat="server" Text='<%# string.Format( "{0} to {1} Years", DataBinder.Eval(Container, "DataItem.expfrom"), DataBinder.Eval(Container, "DataItem.expto") ) %>' ID="Label1">

<asp:BoundField DataField="title" HeaderText="TITLE">


<asp:BoundField DataField="Industry" HeaderText="INDUSTRY">


<PagerStyle BackColor="Silver" HorizontalAlign="Center" />

in the above i have used hyperlinkfield in which im using DataNavigateUrlFormatString properties to pass query string to other page............ Plz understand this hyperlink field properly i think you will get your answer..........

Vikash Pathak

kallamjreddy-17301, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: kallamjreddy-17301 on: 8/11/2012 [Member] Starter | Points: 25

Hi Vikash,

Thank u so much but , i have got a requirement in such a way that i have to bind the data to grid from .cs file i can bind it directly.
If u could help me i would be thankful to u.


kallamjreddy-17301, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response