bound HyperLinkColumn produces 3 columns

J

John A Grandy

why is it that the following DataGrid produces 3 columns ? i expected only 1
column !





<asp:DataGrid ID="dg1" Runat="server">

<Columns>

<asp:HyperLinkColumn Visible="True" DataTextField="urlText"
DataNavigateUrlField="urlNavigate" />

</Columns>

</asp:DataGrid>





for each DataGrid row, the left-most column is a navigable hyperlink, the
middle column displays the plain-text value of the DataSource's "urlText"
DataColumn, and the right-most column displays the plain-text value of the
DataSource's "urlNavigate" DataColumn ...
 
K

Ken Cox [Microsoft MVP]

Hi John,

Is it using autogeneratecolumns? Try switching that off:

<asp:datagrid ID="dg1" Runat="server"
autogeneratecolumns="False">
<columns>
<asp:hyperlinkcolumn DataNavigateUrlField="urlNavigate"
DataTextField="urlText"></asp:hyperlinkcolumn>
</columns>
</asp:datagrid>

Ken
Microsoft MVP [ASP.NET]
Toronto
 

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,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top