DataGrid loses view state if first column is a template column.

K

Ken Varn

I have a problem where my DataGrid would not maintain the ViewState of my
databound rows. I finally narrowed down the problem. If my first column is
a template column, the view state for the DataGrid items is not maintained
on postback for some reason.

I basically re-created my DataGrid again just to make sure this was indeed
the problem. The ViewState was fine until I added the template column at
the beginning of the Columns list. After that, no more items in the
ViewState on postback.

Could someone explain if this is a known problem and how to fix it?

--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.

EmailID = varnk
Domain = Diebold.com
-----------------------------------
 
K

Ken Varn

Here is an update on this problem. The datagrid has a mixture of bound and
unbound items.

If I add any unbound template items that are server side form controls, such
as checkbox, button, etc.. to the DataGrid, the DataGrid will not maintain
the view state of the bound items on postback. Thus, I lose all of the
datagrid contents when I postback. What gives?

--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.

EmailID = varnk
Domain = Diebold.com
 

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,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top