我使用 ListView,如果我对项目进行鼠标悬停,我想获得另一种颜色和另一种字体大小和字体颜色……另一种颜色有效,但我可以在鼠标悬停时进行两个或多个样式更改吗?
这是我的列表视图:
<asp:ListView runat="server" ID="myListView" OnItemCommand="myListView_ItemCommand"
OnSelectedIndexChanging="myListView_SelectedIndexChanging"
>
<LayoutTemplate>
<table runat="server" class="tablelistview" cellpadding="0" cellspacing="0">
<tr class="TableClass">
<th align="left" runat="server"><asp:LinkButton ID="lnkLastname" runat="server" CssClass="MyLink" OnClick="lnkLastnameSort_Click" >Nachname</asp:LinkButton>
<asp:Image runat="server" ID="imgLastnameAsc" ImageUrl="~/App_Theme/asc.png" />
<asp:Image runat="server" ID="imgLastnameDESC" ImageUrl="~/App_Theme/desc.png" Visible="false" />
</th>
<th class="TableColumns" runat="server"><asp:LinkButton ID="lnkFirstname" CssClass="MyLink" runat="server" OnClick="lnkFirstnameSort_Click" >Vorname</asp:LinkButton>
<asp:Image runat="server" ID="imgFirstnameAsc" ImageUrl="~/App_Theme/asc.png" Visible="false" />
<asp:Image runat="server" ID="imgFirstnameDesc" ImageUrl="~/App_Theme/desc.png" Visible="false" />
</th>
<th class="TableColumns" runat="server"><asp:Label ID="lnkPhone" runat="server" >Telefon</asp:Label></th>
<th class="TableColumns" runat="server"><asp:LinkButton ID="lnkDepartment" CssClass="MyLink" runat="server" OnClick="lnkDepartmentSort_Click">Abteilung</asp:LinkButton>
<asp:Image runat="server" ID="imgDepartmentAsc" ImageUrl="~/App_Theme/asc.png" Visible="false" />
<asp:Image runat="server" ID="imgDepartmentDesc" ImageUrl="~/App_Theme/desc.png" Visible="false" />
</th>
<th class="TableColumns" runat="server"><asp:LinkButton ID="lnkemail" CssClass="MyLink" runat="server" OnClick="lnkMailSort_Click" >Email</asp:LinkButton>
<asp:Image runat="server" ID="imgMailAsc" ImageUrl="~/App_Theme/asc.png" Visible="false" />
<asp:Image runat="server" ID="imgMailDesc" ImageUrl="~/App_Theme/desc.png" Visible="false" />
</th>
</tr>
<tr runat="server" id="ItemPlaceholder">
</tr>
</table>
</LayoutTemplate>
<ItemTemplate>
<tr class="TableClassO" runat="server" onmouseover="this.style.backgroundColor='#838383'" onmouseout="this.style.backgroundColor='#ffffff'" titel="Auswahl">
<td align="left"><asp:LinkButton CssClass="MyLink" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label4" Text='<%# Eval("Nachname") %>' runat="server" /></td>
<td align="left"><asp:LinkButton CssClass="MyLink" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label3" Text='<%# Eval("Vorname") %>' runat="server" /></td>
<td align="left"><asp:LinkButton CssClass="MyLink" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label5" Text='<%# Eval("Telefonnummer") %>' runat="server" /></td>
<td align="left"><asp:LinkButton CssClass="MyLink" CommandName="abteilung" CommandArgument='<%# Container.DataItemIndex %>' ID="Label7" Text='<%# Eval("Abteilung") %>' runat="server" /></td>
<td align="left"><asp:ImageButton Width="15" Height="15" CssClass="MyLink" CommandName="mailto" CommandArgument='<%# Container.DataItemIndex %>' ID="Label8" ImageUrl="~/App_Theme/Email.ico" runat="server" />
<asp:LinkButton CssClass="MyLink" CommandName="mailto" CommandArgument='<%# Container.DataItemIndex %>' ID="Label2" Text='<%# Eval("eMail") %>' runat="server" ToolTip="Öffnet Outlook" /></td>
<td align="left"><asp:Label ID="Label6" Text='<%# Eval("GUID") %>' runat="server" Visible="False" /></td>
</tr>
</ItemTemplate>
<AlternatingItemTemplate>
<tr class="TableClassO" runat="server" style="background-color:#E5EDF5;" onmouseover="this.style.backgroundColor='#838383'" onmouseout="this.style.backgroundColor='#E5EDF5'" titel="Auswahl">
<td align="left"><asp:LinkButton CssClass="MyLink" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label4" Text='<%# Eval("Nachname") %>' runat="server" /></td>
<td align="left"><asp:LinkButton CssClass="MyLink" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label3" Text='<%# Eval("Vorname") %>' runat="server" /></td>
<td align="left"><asp:LinkButton CssClass="MyLink" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label5" Text='<%# Eval("Telefonnummer") %>' runat="server" /></td>
<td align="left"><asp:LinkButton CssClass="MyLink" CommandName="abteilung" CommandArgument='<%# Container.DataItemIndex %>' ID="Label7" Text='<%# Eval("Abteilung") %>' runat="server" /></td>
<td align="left"><asp:ImageButton Width="15" Height="15" CssClass="MyLink" CommandName="mailto" CommandArgument='<%# Container.DataItemIndex %>' ID="Label8" ImageUrl="~/App_Theme/Email.ico" runat="server" />
<asp:LinkButton CssClass="MyLink" CommandName="mailto" CommandArgument='<%# Container.DataItemIndex %>' ID="Label2" Text='<%# Eval("eMail") %>' runat="server" ToolTip="Öffnet Outlook" /></td>
<td align="left"><asp:Label ID="Label6" Text='<%# Eval("GUID") %>' runat="server" Visible="False" /></td>
</tr>
</AlternatingItemTemplate>
<EmptyDataTemplate>
<div><h4>Es wurden keine Einträge gefunden</h4></div>
</EmptyDataTemplate>
</asp:ListView>