Hi Bruno,
Thanks for the info but..... I tried your code suggestion but it still gives
me this error:
<Columns>
<asp:HyperLinkColumn Text="View" DataNavigateUrlField="UserId"
DataNavigateUrlFormatString="ViewInfo.aspx?id={0}" >
<HeaderStyle BackColor="#CCCCCC"></HeaderStyle>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:HyperLinkColumn>
<asp:BoundColumn DataField="SortOrder" HeaderText="Sort Order"
SortExpression="SortOrder">
<ItemStyle HorizontalAlign="Center" Width="12%"></ItemStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="Description" HeaderText="Description">
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="UserName" HeaderText="UserName"
SortExpression="UserName">
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:BoundColumn>
<asp:Templatecolumn>
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "Description") %>
<br />
<asp:HyperLink runat="server" id="myLink" text="more..." NavigateUrl='<%#
DataBinder.Eval("Ruleid", "ViewInfo.aspx?id={0}") %>' />
</ItemTemplate>
</asp:Templatecolumn>
</Columns>
gives me this error:
DataBinder.Eval: 'System.String' does not contain a property with the name
ViewInfo.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Web.HttpException: DataBinder.Eval:
'System.String' does not contain a property with the name ViewInfo.
Source Error:
<%# DataBinder.Eval(Container.DataItem, "Description") %>
<br />
<asp:HyperLink runat="server" id="myLink" text="more..." NavigateUrl='<%#
DataBinder.Eval("Ruleid", "ViewInfo.aspx?id={0}") %>' />
</ItemTemplate>
</asp:Templatecolumn>
"Bruno Alexandre" <br*********@gmail.com> wrote in message
news:e8**************@TK2MSFTNGP02.phx.gbl...
using templates :-)
templates give you all teh free in the world to add something into the
cell in a row...
after the last </asp:BoundColumn>
add this for example: (just copy/paste)
<asp:TemplateField>
<ItemTemplate>
<%#Eval("Description")%> <br />
<asp:HyperLink runat="server" id="myLink" text="more..."
NavigateUrl='<%# Eval("UserId", "ViewInfo.aspx?id={0}") %>' />
</ItemTemplate>
</asp:TemplateField>
and then tell me the result ;-)
--
Bruno Alexandre
(a Portuguese in Københanv, Danmark)
"Stephen" <st********@hotmail.com> escreveu na mensagem
news:OF**************@TK2MSFTNGP02.phx.gbl... Hi,
Is there anyway I can make a column thats databound into a hyperlink to
navigate to another page?
Suppose I have 3 columns: SortOrder, Description, UserName
for eg:
<Columns>
<asp:HyperLinkColumn Text="View" DataNavigateUrlField="UserId"
DataNavigateUrlFormatString="ViewInfo.aspx?id={0}" >
<HeaderStyle BackColor="#CCCCCC"></HeaderStyle>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:HyperLinkColumn>
<asp:BoundColumn DataField="SortOrder" HeaderText="Sort Order"
SortExpression="SortOrder">
<ItemStyle HorizontalAlign="Center" Width="12%"></ItemStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="Description" HeaderText="Description">
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="UserName" HeaderText="UserName"
SortExpression="UserName">
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:BoundColumn>
</Columns>
Instead of having HyperLinkColumn with "View" as text, how can I make
"Description" or whatever column I want
into the hyperlink (with the relevant info to display) and navigate it
to "ViewInfo.aspx?id={0}
please Advice,
Stephen