我有以下代码...
<asp:DetailsView ID="dvApprenticeship" runat="server" DataSourceID="dsApprenticeship" AutoGenerateRows="false" BackColor="#E0E8F0" GridLines="None" CellPadding="2"
DataKeyNames="ProgramID, ProgramName, OrganisationName, StudyYearID, Workgroup, Pathway, FinishDate" OnDataBound="Apprenticeship_DataBound">
<Fields>
<asp:BoundField DataField="ProgramName" HeaderText="Program:" />
<asp:BoundField DataField="StudyYearName" HeaderText="Study Year:" />
<asp:HyperLinkField DataTextField="OrganisationName" HeaderText="Apprenticeship: " NavigateUrl="Apprenticeships.aspx" />
<asp:BoundField DataField="Workgroup" HeaderText="Workgroup:" />
<asp:BoundField DataField="Pathway" HeaderText="Pathway:" />
<asp:TemplateField HeaderText="Nominal Completion: ">
<ItemTemplate>
<asp:Label ID="labEndDate" runat="server" Text='<%# Eval("FinishDate","{0:d/MM/yyyy}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Fields>
<FooterTemplate>
<asp:LinkButton ID="lbAddProgramUnits" runat="server" OnClick="AddProgramUnits_Click" ForeColor="White" Font-Bold="true"
OnClientClick="return confirm('Import the Program Units listed - this may overwrite unit dates. Are you sure?');">Import from Program</asp:LinkButton>
<a href="#" onclick="showhelp('progimphelp');" style="color:White;font-weight:bold;">Help</a>
</FooterTemplate>
<FooterStyle HorizontalAlign="Center" BackColor="LightSlateGray" />
</asp:DetailsView>
每当上述 Boundfields 之一改变颜色时,我希望能够显示工具提示。
在我的 C# 代码隐藏中,我的代码可以根据数据的某些条件更改这些绑定字段的颜色。这工作正常。
但是我想要的是能够在用户将鼠标悬停在这些 Boundfields 上时为用户提供工具提示,并且仅当该字段的颜色不同时,在我的情况下
颜色.黄色
.