473,581 Members | 3,046 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataGrid and Repeater strange disappearance bug

I'm fighting a really strange bug that involves both a DataGrid and a
Repeater disappearing on postback. The strange thing is that I've
distilled the problem down to a simple program, that originally could
reproduce the problem, but now can't, even as I add complexity back
in.

The basic scenario is a custom DataGrid (just make a class that
derives from DataGrid) that has a LinkButton in a HeaderTemplate that
has a CommandName="so rt" and CommandArgument ="whatever". Only
DataBind if it's not a postback, and there you go. (I can give more
code later). It's actually a bit more complicated in that sorting and
paging are handled mostly within the control. I've intercepted almost
all the handlers I can to see what is different between the working
version and the non-working version (sometimes just a difference in
time of day it seems). Here's what I found.

Postback (when it's working):
grid OnInit
page OnInit
grid LoadViewState
grid CreateControlCo llection
grid InitializeItem
page OnLoad
grid OnLoad
OnSortCommand

Postback (when it doesn't work - and DataGrid disappears):
grid OnInit
page OnInit
grid CreateControlCo llection
grid LoadViewState
page OnLoad
grid OnLoad

The actual control is IDENTICAL in both cases. I'm pulling my hair
out to figure out what is possibly different. This problem is driving
me crazy, especially since I originally duplicated the problem in a
simplified test case. Once I changed a small something that caused
the problem to go away in the test case, I then went and changed it
back, and WHAMMO, it didn't happen again. In fact, I can't get it to
happen at all in my test case again, even though all the code is
almost a duplicate of my bigger app. Any leads at all will be greatly
appreciated. I'll post more code tomorrow.
Nov 18 '05 #1
1 1343
Hi Tim:

I think we will need to see some more code. When you do the sorting,
is there any possibility you could be binding to an empty DataSource?

--
Scott
http://www.OdeToCode.com/blogs/scott/

On 1 Nov 2004 21:17:03 -0800, ti*******@omega creations.com (Kepler)
wrote:
I'm fighting a really strange bug that involves both a DataGrid and a
Repeater disappearing on postback. The strange thing is that I've
distilled the problem down to a simple program, that originally could
reproduce the problem, but now can't, even as I add complexity back
in.

The basic scenario is a custom DataGrid (just make a class that
derives from DataGrid) that has a LinkButton in a HeaderTemplate that
has a CommandName="so rt" and CommandArgument ="whatever". Only
DataBind if it's not a postback, and there you go. (I can give more
code later). It's actually a bit more complicated in that sorting and
paging are handled mostly within the control. I've intercepted almost
all the handlers I can to see what is different between the working
version and the non-working version (sometimes just a difference in
time of day it seems). Here's what I found.

Postback (when it's working):
grid OnInit
page OnInit
grid LoadViewState
grid CreateControlCo llection
grid InitializeItem
page OnLoad
grid OnLoad
OnSortComman d

Postback (when it doesn't work - and DataGrid disappears):
grid OnInit
page OnInit
grid CreateControlCo llection
grid LoadViewState
page OnLoad
grid OnLoad

The actual control is IDENTICAL in both cases. I'm pulling my hair
out to figure out what is possibly different. This problem is driving
me crazy, especially since I originally duplicated the problem in a
simplified test case. Once I changed a small something that caused
the problem to go away in the test case, I then went and changed it
back, and WHAMMO, it didn't happen again. In fact, I can't get it to
happen at all in my test case again, even though all the code is
almost a duplicate of my bigger app. Any leads at all will be greatly
appreciated. I'll post more code tomorrow.


Nov 18 '05 #2

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

Similar topics

3
1791
by: Jeremy Ames | last post by:
I am trying to use a datagrid to pull information from a database. I prefer to use latebinding to this. Well, I finally got my information to populate the datagrid, but the information came out in a table format. Is there a way that I can make the datagrid use list box or some other kind of grid? Perhaps I am using the wrong components....
2
3284
by: Stephen Miller | last post by:
I am using the OnItemDataBound event of Repeater control to nest a DataGrid within the Repeater. When I attempt to bind to the DataGrid using the DataSource method I get the error message "Object reference not set to an instance of an object". This error message commonly occurs when a server control is incorrecly declared, so naturally I have...
1
4299
by: Rick | last post by:
Hello all, I hope all is well with you. I am having a seriously difficult time with this problem. Allow me to set up the problem. I have a System.Web.UI.Page with the following controls (watch the layout, some have child controls):
7
1993
by: Scott Schluer | last post by:
Hi All, I have a functioning datagrid on "Page 1" that displays order information for a single order (this is for an e-commerce site). It's actually a combination of a couple datagrids to display all of the information. I now have a need to drop this datagrid into a repeater on "Page 2". The repeater will grab ALL orders within a given...
2
1788
by: News | last post by:
Hi I need help to display and edit data in a data grid within a repeater. The code is below: Sub dgrdEvents_EditCommand(sender As Object, e As DataGridCommandEventArgs) dgrdEvents.EditItemIndex = e.Item.ItemIndex BuildList() End Sub
0
1494
by: Ferret | last post by:
I've found what seems to be a nasty bug in the DataGrid and Repeater classes. If CreateChildControls gets called before LoadViewState, ViewState fails to map and you end up with nothing on a Postback. Please try the following test, and let me know if you can reproduce this: - Create a custom DataGrid or Repeater class that does nothing but...
3
1533
by: Maziar Aflatoun | last post by:
Hi everyone, I have a datagrid that I create inside a Repeater at runtime. I have defined a checkbox beside each row so that users can select multiple rows. <asp:datagrid id="dgProducts" HorizontalAlign="Center" AutoGenerateColumns="false" CellPadding="2" runat="server" > ...... <asp:TemplateColumn HeaderText="" HeaderStyle-Width="20">...
1
1548
by: JD | last post by:
Hello Everyone, I am trying to do a page where when the user gets to the page it will look very similar to the following: <table border=1> <tr> <td bgcolor="green" colspan="2">Main Header</td> </tr> <tr><td bgcolor="gray">SubHead1</td><td bgcolor="gray">Subhead2 -
2
1368
by: mark4asp | last post by:
This page is currently using a Repeater control to create a table with 6 columns. The first column has 2 ImageButton controls and a common header. How can I do this with a DataGrid ? I need either 7 columns in my DataGrid with a shared column heading for the first two columns OR I need 6 columns with the first DataGrid column showing two...
0
7886
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7809
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8312
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8183
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6569
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5685
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5366
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3809
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1413
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.