470,614 Members | 1,584 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,614 developers. It's quick & easy.

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

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
-----------------------------------
Nov 19 '05 #1
1 1756
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
-----------------------------------
"Ken Varn" <nospam> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
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
-----------------------------------

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Jim Heavey | last post: by
7 posts views Thread by DJ Dev | last post: by
10 posts views Thread by Jennyfer J Barco | last post: by
6 posts views Thread by Khumar | last post: by
1 post views Thread by John | last post: by
7 posts views Thread by Mark B | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.