Click here to Skip to main content
15,921,622 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
XML
<asp:GridView ID="reportTable" runat="server" CellPadding="5"
                ForeColor="#333333" AllowSorting="True" GridLines="Both"
                AutoGenerateColumns="False">
                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                <Columns>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:CheckBox ID="checkBox" runat="server" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField HeaderText="Auftragsnummer" />
                    <asp:BoundField HeaderText="Mechanische" />
                    <asp:BoundField HeaderText="Elektrische" />

XML
<p>
            <asp:Button ID="select" runat="server" Text="Auftrag koordinieren" onclick="select_Click" />
        </p>




This is displaying a table with grid view with the option of a checkbox for every row.However i would like to make the first entry of the table that is the "auftragsnummer" as a link that will point to the next page instead of scrolling down and selecting on click.Can anyone help me with this?
Posted

1 solution

Replace this:
ASP.NET
<asp:boundfield headertext="Auftragsnummer" xmlns:asp="#unknown" />

With this one:
ASP.NET
<asp:hyperlinkfield xmlns:asp="#unknown">
    DataNavigateUrlFields="UrlColumn"
    DataTextField="YourColumnName"
    HeaderText="Auftragsnummer"
    SortExpression="YourColumnName" />
</asp:hyperlinkfield>


Hope you find it helpful
 
Share this answer
 
Comments
Member 9196002 13-Aug-12 8:48am    
so it will be like

<asp:hyperlinkfield xmlns:asp="#unknown">
DataNavigateUrlFields="?/manage.aspx"
DataTextField="Report_id"
HeaderText="Auftragsnummer"
/>
Christian Amado 13-Aug-12 8:49am    
Yes, must be like you exposed.
Member 9196002 13-Aug-12 9:04am    
the thing is i already tried this way and also adding a hyperlink through the edit column on the design page..it just doesnt seem to take the data text field.keeps on giving me an error saying "report_id" or any other variant i use does not exist in the data source.However in the database table..it is found under report_id itself
Christian Amado 13-Aug-12 9:05am    
Have you got a DataTable or DataSet as DataSource in your GridView?
Member 9196002 13-Aug-12 9:06am    
yes..its a datatable

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900