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

 All Forums
 Development Tools
 ASP.NET
 Itemcreated event on datagrid pageindexchanged

Author  Topic 

bubberz
Constraint Violating Yak Guru

289 Posts

Posted - 2006-10-11 : 10:05:12
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()
Else
Call BuildDG()
End If

Thanks!

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2006-10-11 : 11:24:07
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

bubberz
Constraint Violating Yak Guru

289 Posts

Posted - 2006-10-11 : 11:36:24
Hello!

I put the code in the itemDataBound event and it worked!
Go to Top of Page
   

- Advertisement -