By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,030 Members | 1,997 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,030 IT Pros & Developers. It's quick & easy.

How to keep a field in datagrid as html link...

P: n/a
Hi,
can any one help me how to make a cell in data grid link to another
page.... like i have a field "refno" in my table so when in get the
values from table to datagrid the refno's of every record must link to
another page..
thanks in advance...
SUNNY

Nov 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi

See the NavigateUrl in the datagrid def below.

<asp:datagrid id="DataGridILTables" runat="server" Width="100%"
PageSize="20" AllowPaging="True"
Font-Names="tahoma" BackColor="#F2F0E4" GridLines="None"
BorderStyle="Solid" cellSpacing="1"
cellPadding="1" BorderWidth="3px" BorderColor="Black">
<SelectedItemStyle
BackColor="WhiteSmoke"></SelectedItemStyle>
<AlternatingItemStyle
BackColor="White"></AlternatingItemStyle>
<ItemStyle BackColor="WhiteSmoke"></ItemStyle>
<HeaderStyle BackColor="Control"></HeaderStyle>
<Columns>
<asp:TemplateColumn>
<HeaderStyle Width="50%"></HeaderStyle>
<HeaderTemplate>
Table Name
</HeaderTemplate>
<ItemTemplate>
<TABLE style="BACKGROUND-COLOR: transparent"
cellSpacing="0" cellPadding="1" border="0">
<TR>
<TD>
<asp:HyperLink id=HyperLinkMaintainTableIMG
runat="server" Width="3px" NavigateUrl='<%#
DataBinder.Eval(Container.DataItem, "OnClick")%>' Height="7px"
ImageUrl="images/i_data_table_off.gif">
</asp:HyperLink></TD>
<TD>
<asp:HyperLink id=HyperLinkMaintainTableLabel
runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Table
Name")%>' NavigateUrl='<%# DataBinder.Eval(Container.DataItem,
"OnClick")%>' Font-Underline="True">
</asp:HyperLink></TD>
</TR>
</TABLE>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
<PagerStyle Mode="NumericPages"></PagerStyle>
</asp:datagrid>
Reagards,

Daniel Roth
MCSD.NET

Its_Me_SunnY wrote:
Hi,
can any one help me how to make a cell in data grid link to another
page.... like i have a field "refno" in my table so when in get the
values from table to datagrid the refno's of every record must link to
another page..
thanks in advance...
SUNNY


Nov 19 '05 #2

P: n/a
TJS
<asp:templatecolumn headertext="">
<itemtemplate>
<asp:hyperlink
navigateurl='<%# "targetpage.aspx?refno=" &
Container.DataItem("refno")) %>'
id="Hyperlink1"
runat="server"
target="_blank"
text="View" />
</itemtemplate>
</asp:templatecolumn>
"Its_Me_SunnY" <fr****************@gmail.com> wrote in message
news:11*********************@g49g2000cwa.googlegro ups.com...
Hi,
can any one help me how to make a cell in data grid link to another
page.... like i have a field "refno" in my table so when in get the
values from table to datagrid the refno's of every record must link to
another page..
thanks in advance...
SUNNY

Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.