You could use, asp:TemplateColumn to have this hyperlink
field. Here is the sample code.
Thanks,
Muhammad Arif
System Analyst, UHC
<asp:datagrid id="ReportGrid" AutoGenerateColumns="False"
Runat="server">
<ItemStyle
HorizontalAlign="Center"></ItemStyle>
<HeaderStyle Font-Size="10pt" Font-
Names="Verdana" Font-Bold="True" HorizontalAlign="Center"
BackColor="#D4DEE3"></HeaderStyle>
<Columns>
<asp:TemplateColumn HeaderText="Download Voice File">
<HeaderTemplate>
Voice
Dictation
</HeaderTemplate>
<ItemTemplate>
<asp:hyperlink runat="server"
Text="Listen/Download" NavigateUrl='<%
# "../../CommonServices/WebPages/DownloadWavFile.aspx?id="
+DataBinder.Eval(Container.DataItem,"VoiceFileName ") %>'
Target="_new" ID="Hyperlink3"/>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn
HeaderText="Report Activity Log">
<HeaderTemplate>
Report
Activity Log
</HeaderTemplate>
<ItemTemplate>
<ASP:HYPERLINK id=hlViewActivityLog runat="server"
Target="_new" NavigateUrl='<%# "HViewActivityLog.aspx?id="
+DataBinder.Eval(Container.DataItem,"PkId") %>' Text="View
Log" />
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>
-----Original Message-----
This is a repost from the other dotnet.csharp forum:
I'm including a simple datagrid control on my web form. I
have createda Dataview (reportListView) onto a data table to populate
it. At itssimplest it works - if I define the datasource for the
grid to be'reportListView' and use autogenerate columns then I get
all columnsof the view appearing when the page is viewed.
However I now want to restrict the number of columns to
be displayedand also to create a hyperlink column. This should be
simple, but whenI try to define the columns (within the properties of the
grid), Idon't get any opportunity to select individual fields in
the datasource (whereas all of the documentation implies that I
will be ableto do so). For instance, no columns are available in
the 'AvailableColumns' window; I can't see any text fields within the
HyperlinkColumn properties, etc.
It's as if the dataview cannot be expanded correctly when
I'mdesigning the grid. I'm extremely inexperienced in this
area, so anyadvice gratefully appreciated.
- Rob.
.