Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
340
accessing webdatechooser values in ultrawebgrid
posted

I have a webdatechooser control assigned to multiple ultragrid columns. Everything works fine with the calendar and selecting dates.

However when I try and access the values via the rows of the grid it throws an exception when it hits the date column.

"Object reference not set to an instance of an object.

For Each row As Infragistics.WebUI.UltraWebGrid.UltraGridRow In DrawWebGrid1.Rows

       params(8) = New SqlParameter("@PStartDate", row.GetCellValue(DrawWebGrid1.Columns.FromKey("PStartDate")))

Next

If I stop in debug and look at the value set for that row it is the date string that was originally used

to initialize the field and not the data that appeared when the calander was clicked as if it did not bind to the grid somehow.

  • 28464
    posted

    Hello,

    "Object Reference Not Set To An Instance" could mean that any object in any part of the code sample could be null / not set to a reference. e.g. even the params collection or params(8) could be null. My suggestion is to break the code snippets into smaller parts (one at a line) and trace with a debugger to see what is going on.