p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   ASP.NET 2.0 Professional (http://p2p.wrox.com/forumdisplay.php?f=215)
-   -   four Nested gridviews with data (http://p2p.wrox.com/showthread.php?t=50340)

KamalRaturi November 15th, 2006 10:17 PM

four Nested gridviews with data
 
hi ,

I use bound four Nested gridviews with data in .aspx page using template field. The Innermost grid rows do have IDs of products in hiddenfield value and a checkbox for each value,when user checks the selected checkboxes, and click the submit button I do not know how a string can be made with these IDs.

I tried at my level but.......

the code and Error is:

For Each gRow1 In GridView1.Rows
            If CType(gRow1.TemplateControl.FindControl("gridview2 "), GridView).HasControls Then
//err here// gdView = CType(gRow1.TemplateControl.FindControl("gridview2 "), GridView)
                MsgBox("G1")
                For Each gRow2 In gdView.Rows
                    If CType(gRow1.FindControl("gridview3"), GridView).HasAttributes Then
                        gdView = CType(gRow1.FindControl("gridview3"), GridView)
                        For Each gRow3 In gdView.Rows
                            If CType(gRow1.FindControl("gridview4"), GridView).HasAttributes Then
                                gdView = CType(gRow1.FindControl("gridview4"), GridView)
                                For Each gRow4 In gdView.Rows
                                    chkTitle = CType(gRow4.FindControl("ckSelect"), CheckBox)
                                    If chkTitle.Checked = True Then
                                        ifAnyChecked = True
                                        hdnValue = CType(gRow4.FindControl("hdnQuestionID"), HiddenField)
                                        If strID = "" Then
                                            strID = strID & hdnValue.Value
                                        Else
                                            strID = strID & "," & hdnValue.Value
                                        End If
                                    End If
                                Next
                            End If
                        Next
                    End If
                Next
            End If
        Next
        MsgBox(strID)



Error:Object reference not set to an instance of an object.


Please Tell me Solution if U know, Thanks in Advance.


All times are GMT -4. The time now is 06:34 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.