473,406 Members | 2,217 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,406 software developers and data experts.

DataGrid items not available on postback

I'm trying to develop a page template for the ASP.NET 1.1 project I'm
working on. I want to have something like Master Pages (from ASP.NET
2.0). I'm having a problem now with databinding on a simple DataGrid.
When the page, PlanCopySelection2.aspx, loads initially it loads, and
data binds, correctly. This page has a few checkboxes in the DataGrid.
When I submit the page and handle the click event, I'm losing the line
items in the DataGrid. I think this is because the
CreateChildControls() function is being invoked, and the
ChildControlsCreated property is false. This caused the
MainContentTemplate to databind again, and I believe, all controls
under the MainContentTemplate. Thus, the DataGrid is rebound and all
the items are cleared. Hopefully I'm making some sense here.

I know one work-around is to not check the IsPostBack property on
PlanCopySelection2.aspx. That would allow all the databinding on the
DataGrid to occur again. This is unnecessary I think. I would like to
understand why this is all occuring. I think I'm just missing
something in the event flow of the page and subsequent controls. I'm
wondering if I need to do something with the databinding events
(OnDataBind() perhaps).

If you're interested in the source code, please respond and I'll be
happy to email you the code.
Thanks

Feb 13 '06 #1
0 1026

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Glenn Owens | last post by:
I have a DataGrid web control which I've dynamically populated with template columns to be used for bulk-editting. Generally, all of the columns are textbox and/or dropdownlist child controls. ...
2
by: Dave | last post by:
Hi, I'm building a maintenance form for a table and some of the fields are textboxes (i.e name) and some should be dropdowns (i.e country of origin) When a user clicks 'Edit' in the...
1
by: Ken Varn | last post by:
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...
2
by: Kel Good | last post by:
I have a shopping cart datagrid that is filled only the first time the page is accessed, like so: If Page.IsPostBack = False Then RetrieveShoppingCart() End If The user can then change the...
2
by: Gummy | last post by:
Hello All, I have a webpage that has two dropdown listboxes. Based on what is selected in these dropdown listboxes, it filters a DataGrid . That works fine. In the DataGrid , when I go to edit...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.