Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > DataGrid loses view state if first column is a template column.

Reply
Thread Tools

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

 
 
Ken Varn
Guest
Posts: n/a
 
      08-18-2005
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
-----------------------------------


 
Reply With Quote
 
 
 
 
Ken Varn
Guest
Posts: n/a
 
      08-19-2005
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:%(E-Mail Removed)...
> 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
> -----------------------------------
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
setting Column width of Template Column in Datagrid.. Charleees ASP .Net 2 06-20-2006 12:52 PM
bind a dropdown in a column in a datagrid based on the dropdown value selected in another column of the datagrid. vishnu ASP .Net 1 03-25-2006 01:24 PM
how to know if a datagrid column is a template column? Dexter ASP .Net 1 01-18-2005 01:45 PM
how do i access a dropdownlists selected value in a datagrid edititemtemplate column from the selectedindexchanged event of another dropdownlist in a datagrid edititemtemplate column Dave M ASP .Net Datagrid Control 0 12-14-2004 11:53 AM
Bound Column or Template Column (w dAdapater?) in DataGrid Ravichandran Mahalingam ASP .Net Datagrid Control 0 01-09-2004 03:30 PM



Advertisments