SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 Development Tools
 Itemcreated event on datagrid pageindexchanged
 New Topic  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: http://weblogs.sqlteam.com/mladenp
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  
 New 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.06 seconds. Powered By: Snitz Forums 2000