473,396 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 1866
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Ashish Shridharan | last post by:
Hi All I have been trying to add a control to the header cell of a datagrid on my ASP.NET page. These controls are defined in the HTML as ASP.NET web controls. They are being added into the...
3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
7
by: DJ Dev | last post by:
Hi All, I have a complex problem. I have dropdownlists (usually 3-5) and the user selects some value from these and for each value selected, datagrids are shown to the user. I am creating the...
10
by: Jennyfer J Barco | last post by:
Hello, I have a datagrid that brings some information from a query. I need to have a checkbox in each row so the user can select the rows he wants to reprint. Is it possible to have a checkbox...
0
by: optimizeit | last post by:
What I am attempting to do is import an Excel Workbook and display the worksheets in a datagrid dynamically. I am very close to getting this to work. I have to this point successfully imported a...
6
by: Khumar | last post by:
Hello, Im new in asp.net especially in web base application. I want to ask about datagrid. I had shown my table on datagrid, and what I want to ask is how to set the column height fixed?...
1
by: sianan | last post by:
I tried to use the following example, to add a checkbox column to a DataGrid in an ASP.NET application: http://www.codeproject.com/aspnet/datagridcheckbox.asp For some reason, I simply CAN'T get...
1
by: John | last post by:
I am using the ItemDataBound event on the datagrid to place relevant images in the grid. However, when I press any button on the form which fires a postback the state of the grid is kept but the...
7
by: Mark B | last post by:
Can someone write some VB.Net example code for me that does this: 1) Creates a gridview control with the results of a SQL stored procedure that has 1 parameter (text) 2) Adds an extra column...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.