Object Reference Not Set / GridView TemplateItem

R

Ross Culver

Here's a curious one . . .

In one column of my gridview, I have two templateitems, one above the other
(namely company name and street address, respectively). Works fine.

On gv.SelectedIndexChange I capture the street address into a session
variable for further processing thusly (addr =
me.gv.SelectedRow.Cells(2).Text) and when the result set is more than 10 (my
PageSize) everything's fine. But whenever the result set is less than 10
resulting in only one page, I get the ole' "object reference not set ....."
message on gvSelectIndexChange.

I thought it might be occurring whenever the company name field was blank,
but that's not the problem. I would specify the exact templateitem since
there are actually two templateitems in the same cell, but I don't know how
to do that using code behind.

Any suggestions?

Thanks,

Ross
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,818
Messages
2,569,727
Members
45,676
Latest member
ManuelaHol

Latest Threads

Top