我有一个带有一个单元格的gridview,它将显示另一个gridview作为工具提示,数据从DB加载,但每次加载主gridview时都会显示工具提示gridview。我想只有当用户将鼠标悬停在单元格上时才显示工具提示gridview。
任何想法如何只在用户鼠标悬停到单元格标签时才能显示工具提示gridview?
<asp:GridView ID="gvINCpym" runat="server" AllowSorting="True" AutoGenerateColumns="False"
CaptionAlign="Left" CssClass="GridViewStyle" EmptyDataText="No Record Found"
GridLines="None" ShowFooter="True" Width="960px"
AllowPaging="True">
<RowStyle CssClass="RowStyle" />
<EmptyDataRowStyle CssClass="EmptyRowStyle" />
<Columns>
<asp:TemplateField HeaderText="QB (30%)">
<ItemTemplate>
<asp:Label ID="lblQB" runat="server" Text="<%# Bind('QB') %>"></asp:Label>
<cc1:HoverMenuExtender ID="HoverMenuExtender1" runat="server" TargetControlID="lblQB"
PopupControlID="pnlQBDet" PopupPosition="Right" OffsetX="0" OffsetY="0"
PopDelay="25">
</cc1:HoverMenuExtender>
<asp:Panel ID="pnlQBDet" runat="server">
<asp:GridView ID="gvQBDet" runat="server">
</asp:GridView>
</asp:Panel>
</ItemTemplate>
<HeaderStyle CssClass="HeaderStyle" Width="80px" />
<ItemStyle HorizontalAlign="Right" Width="80px" />
</asp:TemplateField>
</Columns>
</asp:GridView>
Private Sub gvINCpym_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvINCpym.RowDataBound
Try
If (e.Row.RowType = DataControlRowType.DataRow) Then
Dim secondGrid As GridView = CType(e.Row.FindControl("gvQBDet"), GridView)
MsFg2.gvSql =
"SELECT SUBSTRING(CONVERT(VARCHAR(11), DATE1, 113), 4, 8) AS CalcMnth, AMT2 AS QB, AMT3 AS KB " & _
"FROM dbo.Inc_Bonus_Tran NOLOCK " & _
"WHERE (DATE2 BETWEEN '" & CVRMgr.getDateSQL(txtDtFrm.Text) & "' AND '" & CVRMgr.getDateSQL(txtDtTo.Text) & "') " & _
"AND TYPE = 'INC' AND SUBTYPE = 'T2' " & _
"AND STAFFID = '" & rowView("StfID") & "'"
MsFg2.CreateDataTable(DB, MsFg2.gvSql, cnnVLD, True, True)
Session(MsFg2Ses) = MsFg2.gvDataTable.DefaultView.ToTable
secondGrid.DataSource = Session(MsFg2Ses)
secondGrid.DataBind()
End If
Catch ex As Exception
cMessageManagerAlertOnly.ErrorMsgAlert(ex.Message, Me.Page)
End Try
End Sub
答案 0 :(得分:1)
管理以找出解决方案。将需要使用CSS隐藏面板'pnlQBDet',以便工具提示gridview不会显示在页面加载/回发上。
<style type="text/css">
.PopupMenu
{
display: none;
}
</style>