Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 Development Tools
 Itemcreated event on datagrid pageindexchanged
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Constraint Violating Yak Guru

289 Posts

Posted - 10/11/2006 :  10:05:12  Show Profile  Reply with Quote
My basic goal is to highlight a row if there's a certain data condition. This is fine, until the user tries to page to the next page, and I get the:
"Object not set to an instance of an object"

I went through the code, and if I comment out my ItemCreated even of the datagrid, I can page successfully.

Do I need to call something in my PageIndexChanged event so the ItemCreated event gets called as well?
Here's the pageindexchanged event:

DG.CurrentPageIndex = e.NewPageIndex
If txtWBSNumber.Text <> String.Empty Then
Call BuildDGFiltered()
Call BuildDG()
End If


Cybernetic Yak Master

11752 Posts

Posted - 10/11/2006 :  11:24:07  Show Profile  Visit spirit1's Homepage  Reply with Quote
which object isn't set?

Go with the flow & have fun! Else fight the flow
blog thingie:
Go to Top of Page

Constraint Violating Yak Guru

289 Posts

Posted - 10/11/2006 :  11:36:24  Show Profile  Reply with Quote

I put the code in the itemDataBound event and it worked!
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000