brownnewyork
New Member
I'm trying to show a gridview as tooltip of a cell in a gridview and I have tried with the code below but it's giving me the error, 'Object reference not set to an instance of an object.' Any idea how to solve this?\[code\]<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> <aspanel ID="pnlQBDet" runat="server"> <asp:GridView ID="gvQBDet" runat="server"> </asp:GridView> </aspanel> </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 TryEnd Sub\[/code\]