Unbound datagrid - no items on ItemCommand

D

Diane Y

I'm having major issues with an unbound datagrid.

During the first page load (I don't do this on postback), I programmatically
create a dataset with one table and one row and bind it to the datagrid.
The dataset is stored in a page-level, shared variable.

I've got a button in the footer of the datagrid with a command name of
"Insert". When the button is clicked, I have some code in the onItemCommand
event to add a row to the dataset and rebind it to the datagrid. That works
fine, but of course, I lose any changes to the datagrid that were made
before the insert button was pushed.

I thought I'd loop through the datagrid items (in the onItemCommand event)
and update the dataset with the new values before I rebind the datagrid.
Unfortunately, the datagrid items collection only has one item - a footer -
which is crazy because it should have *at least* a header and a footer and
also one item.

Can anyone offer any suggestions as to why my datagrid seems to be getting
lost on postback?
Diane
 

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,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top