473,395 Members | 1,343 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,395 software developers and data experts.

The Incredible Disappearing Table Row

Greetings,

I needed a GridView with an optional extra row in the THEAD and TFOOT.
I extended GridView and used Dino Esposito's CreateRow overload
[http://weblogs.asp.net/despos/archiv...0/272147.aspx] then
added a new template for the header.

I overrode CreateChildControls like this

protected override void CreateChildControls ()
{
base.CreateChildControls();

if (TableHeader != null)
{

// childtable
Table t = (Table)Controls[0];
GridViewRow row = CreateRow( -1, -1, DataControlRowType.Header,
DataControlRowState.Normal);
System.Web.HttpContext.Current.Trace.Warn("Creatin g children");
TemplateContainer c = new TemplateContainer(this);

TableHeaderCell cell = new TableHeaderCell();
cell.ColumnSpan = this.Columns.Count;
TableHeader.InstantiateIn(c);
cell.Controls.Add(c);
row.Cells.Add(cell);

row.CssClass = "mainhead";
t.Rows.AddAt(0, row);

LiteralControl l =
(LiteralControl)t.Rows[0].Cells[0].Controls[0].Controls[0];
System.Web.HttpContext.Current.Trace.Warn(l.Text);
}
}

This works on the first request, but the table row disappears
onpostback.
After much tearing of hair, I found out that the control existed until
GridView.OnPreRender was called.

Does anyone have any idea why OnPreRender would eat my table row?

Nov 19 '05 #1
0 978

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

Similar topics

9
by: Larry Woods | last post by:
I have a site that works fine for days, then suddenly, I start getting ASP 0115 errors with an indication that session variables IN SEPARATE SESSIONS have disappeared! First, for background...
3
by: Csaba2000 | last post by:
I apologize for the length of the page below, but I've tried to whittle it down as much as I can. The problem is that Netscape 6.1 on my Win 2K Pro machine is disappearing the final row of the...
2
by: neptune | last post by:
I built a form to access a query with a 2 field primary key. It should use 2 controls to find the unique record and display the other field values on the form. In the criteria section of the...
2
by: Rachel Suddeth | last post by:
Here is my scenario: I have a few custom controls that I set up on a form and tested setting properties and appearances. Then I added a couple references to the project which add classes I need to...
6
by: Winshent | last post by:
I have read many threads which indicate that this was a problem with version 2002. Why should i be suffering this? I am using VB.NET 2003 Standard Edition... is it still a problem with 2003? ...
2
by: Kevin Audleman | last post by:
I am using a hosted MSSQL 2000 database that powers the backend of my website. Website visitors interact with it via ASP pages I have developed. I also have an internal FileMaker 7 database that...
3
by: mark.szretter | last post by:
Relationships between tables disappear without explanation in the database diagram using SQL Server 2005. Many thanks for any thoughts/questions on the topic!
8
by: Neil | last post by:
I am running an Access 2000 MDB against a SQL 7 back end, using ODBC linked tables over a LAN and a WAN. The system has been operational for years with relatively few problems. Recently, WAN...
2
by: insanity | last post by:
Can anyone help me with a problem that I have with apparently unrelated text disappearing in IE7 when I set a className. This does not happen in Firefox. I am trying to create an Ajax driven...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.