下午好,我有一个gridview(gridview的简历)
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataKeyNames="IDEntretien,Expr2,Expr3" DataSourceID="SqlDataSource12"
EnableModelValidation="True" BackColor="White" BorderColor="#999999"
BorderStyle="None" BorderWidth="1px" CellPadding="3" GridLines="Vertical">
<AlternatingRowStyle BackColor="Gainsboro" />
<Columns>
<asp:BoundField DataField="IDEntretien" HeaderText="IDEntretien"
InsertVisible="False" ReadOnly="True" SortExpression="IDEntretien"
Visible="False" />
<asp:BoundField DataField="IDPersonne" HeaderText="ID"
SortExpression="IDPersonne" />
<asp:BoundField DataField="dtmDate" HeaderText="Date"
SortExpression="dtmDate" DataFormatString="{0:d}" />
<asp:BoundField DataField="strNom" HeaderText="Projet"
SortExpression="strNom" />
<asp:HyperLinkField DataNavigateUrlFields="IDEntretien"
DataNavigateUrlFormatString="ActionASG.aspx?IDEntretien={0}" HeaderText="ASG"
Text="ASG" />
<asp:HyperLinkField DataNavigateUrlFields="IDEntretien"
DataNavigateUrlFormatString="ActionAEPP.aspx?IDEntretien={0}" HeaderText="AEPP"
Text="AEPP" />
</Columns>
<FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
<HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
<RowStyle BackColor="#EEEEEE" ForeColor="Black" />
<SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource12" runat="server"
ConnectionString="<%$ ConnectionStrings:BE Intranet 2009 01 %>"
SelectCommand="SELECT Entretien.IDEntretien, Entretien.IDConseiller, Entretien.IDPersonne, Entretien.dtmDate, Entretien.memCommentaires, Entretien.IDProjet, Projet.strNom, Conseiller.strNom AS Expr1, Conseiller.IDConseiller AS Expr2, Projet.IDProjet AS Expr3 FROM Entretien INNER JOIN Conseiller ON Entretien.IDConseiller = Conseiller.IDConseiller INNER JOIN Projet ON Entretien.IDProjet = Projet.IDProjet WHERE (Entretien.IDPersonne = @IDPersonne)">
<SelectParameters>
<asp:QueryStringParameter Name="IDPersonne" QueryStringField="IDP" />
</SelectParameters>
</asp:SqlDataSource>
我希望当结果出现在 PROJECT - ASG 列(来自表 Projet.strNom)中时,它会变成一个 HyperLinkField,它会引用一个页面“ActionASG.aspx?IDEntretien = {0}”。如果结果发生变化,例如 AEPP,它将引用“ActionAEPP.aspx?IDEntretien = {0}”。目前,该列如下:因此应该更改。???Datanavigateurlfields = "strNom" 根据内容变化,它指的是一个非常具体的页面。
我只是用 C# 编程,我希望我很清楚。在所有情况下,非常感谢您。
莱瑞克