Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking 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 Basics 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 August 14th, 2008, 03:17 PM
Registered User
 
Join Date: Aug 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP.net - Object reference not set to an instance

Hello All,

I'm a relative newbie to asp.net and am having an issue that is getting frustrating. I have page that has an Infragistics UltraWebGrid on it. One of the columns on the grid has a dropdown list. On initial load, it all works great, but on post back I get :Object reference not set to an instance of an object. I put a trace on and can see that it is throwing an "Unhandled Execution Error" at this line:
Quote:
quote:
 at Infragistics.WebUI.UltraWebGrid.UltraGridBand.Syst em.Web.UI.IStateManager.LoadViewState(Object savedState)
Here is the code that seems to be the offender:


Code:
       Dim UnitsCmbAdapt As New SqlDataAdapter(GetMeasureUnits, dbProcurement_DevConnectionString)
        Dim UnitsCmbTable As New DataTable("UnitsCombo")
        Dim UnitsRow As DataRow
        Dim ds As New DataSet
        Dim UnitsValuelist As New Infragistics.WebUI.UltraWebGrid.ValueList()

        UnitsCmbAdapt.Fill(UnitsCmbTable)
        If Not IsPostBack() Then
            For Each UnitsRow In UnitsCmbTable.Rows
                UnitsValuelist.ValueListItems.Add(UnitsRow("unitLiteral").ToString())
                UltraWebGrid1.DisplayLayout.Bands(0).Columns(2).ValueList = UnitsValuelist
            Next
            UltraWebGrid1.DataBind()
            UltraWebGrid1.DisplayLayout.CellClickActionDefault = Infragistics.WebUI.UltraWebGrid.CellClickAction.Edit

        End If
I need the "ViewState" set to true as I need to hold the values of some of the form controls. I've spent a lot of time looking into this and think that I am not instantiating something correctly - but I'm not sure. I did not post this on the Infragistics forums as I don't believe the grid is the issue itself.

I truly appreciate any help you can give!

JCCDEVEL

 
Old August 30th, 2008, 09:25 AM
Friend of Wrox
 
Join Date: Aug 2006
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Default

you can check demo code of infragistic

thanks......





Similar Threads
Thread Thread Starter Forum Replies Last Post
Object reference not set to an instance of an obje rturner003 ASP.NET 2.0 Professional 0 December 26th, 2006 08:30 PM
Object reference not set to an instance of an obj nrathod_97 BOOK: Beginning VB.NET Databases 4 June 21st, 2005 06:35 PM
Object Reference is Not Set to an Instance of an O blackinwhite General .NET 4 February 1st, 2005 05:42 AM
Object reference not set to an instance... steelman BOOK: ASP.NET Website Programming Problem-Design-Solution 6 May 7th, 2004 02:03 AM
Object reference not set to an instance of an obje douknownam BOOK: Beginning ASP.NET 1.0 1 December 18th, 2003 02:56 PM





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