How to recreate custom rows w/o re-binding?

A

aabdis

Here is the problem:

I create a grid, which in ItemCreated() adds in custom header rows on
changes in a particular field's value. All fine-and-dandy the first time
through. On postback however, since the "row" controls were dynamic, they
are no longer there. This of course screws up eventhandlers and such since
now the controls on the page dont match the controls in the viewstate.

How can i recreate those headers? The query that the grid is based on is a
long-running search query and so it really is not desirable to do a re-bind
on the grid. ItemCreated doesnt work anymore, since the grid now no longer
has a datasource. I tried storing all the custom rows and their indices in a
collection server-side and manually re-adding them on postback, but the IDs
do not match up and in fact i wound up getting duplicate ids in the control
tree, which of course ASP complained about.

So how in the world are you supposed to handle custom rows on the postbacks?
Thanks in advance for any help, advice, recommendations, etc.

- --
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top