Wrox Programmer Forums
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old November 15th, 2006, 10:17 PM
Authorized User
Join Date: Aug 2006
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to KamalRaturi Send a message via Yahoo to KamalRaturi
Default 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)
                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
                                            strID = strID & "," & hdnValue.Value
                                        End If
                                    End If
                            End If
                    End If
            End If

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tab across gridviews cdw90nl Javascript How-To 1 February 4th, 2008 05:16 AM
Nested gridviews johncross912 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 2 November 23rd, 2007 03:04 AM
Gridviews lisabb ASP.NET 2.0 Basics 1 May 29th, 2007 11:40 AM
Divs, Gridviews and Javascript != fun mikeymikey ASP.NET 2.0 Professional 1 January 26th, 2007 02:10 PM
Best method - Nested data? bridie Classic ASP Databases 4 February 20th, 2004 12:46 PM

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