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

No display of object - redux

Sue
Anyone have any ideas on why the code below will show up
in a browser's sourcecode as an empty table, and is not
visible?

aspx:
<headertemplate>

<asp:Table ID="MyTable" runat="server" />

</headertemplate>

codebehind:
Class MyClass....

Protected WithEvents CaseTypeHeaderTable As
System.Web.UI.WebControls.Table = New
System.Web.UI.WebControls.Table
Protected WithEvents CaseTypeSortButton As
System.Web.UI.WebControls.Button = New
System.Web.UI.WebControls.Button
Protected WithEvents CaseTypeFilterDropDown As
System.Web.UI.WebControls.DropDownList = New
System.Web.UI.WebControls.DropDownList
Protected WithEvents CaseTypeHRow1 As
System.Web.UI.WebControls.TableRow = New
System.Web.UI.WebControls.TableRow
Protected WithEvents CaseTypeHRow2 As
System.Web.UI.WebControls.TableRow = New
System.Web.UI.WebControls.TableRow
Protected WithEvents CaseTypeHCell1 As
System.Web.UI.WebControls.TableCell = New
System.Web.UI.WebControls.TableCell
Protected WithEvents CaseTypeHCell2 As
System.Web.UI.WebControls.TableCell = New
System.Web.UI.WebControls.TableCell
private sub Page_Load.....
call setMyTable()
end sub

Private Sub setMyTable()
With Me.MySortButton
.BackColor = Color.Maroon
.ForeColor = Color.White
.ID = "MySortButton"
.Text = "Sort This Column"
.ToolTip = "Click to sort this column"
.EnableViewState = True
End With

With Me.MyFilterBox
.ID = "MyFilterBox"
.ToolTip = "Enter value on which to filter records
and press [ENTER]. To show all records clear the box and
press [ENTER]."
.EnableViewState = True
End With

With Me.MyCell1
.VerticalAlign = VerticalAlign.Bottom
.HorizontalAlign = HorizontalAlign.Center
.Controls.Add(Me.MySortButton)
End With

With Me.MyCell2
.HorizontalAlign = HorizontalAlign.Center
.VerticalAlign = VerticalAlign.Top
.Controls.Add(Me.MyFilterBox)
End With

With Me.MyRow1
.Cells.Add(Me.MyCell1)
End With

With Me.MyRow2
.Cells.Add(Me.MyCell2)
End With

With Me.MyTable
.Rows.Add(Me.MyRow1)
.Rows.Add(Me.MyRow2)
End With
End Sub
End Class

tia for any help,
Sue
Jul 19 '05 #1
1 1924
Hi Sue,

After reviewing the description, I think the question is: You want to add
several controls to a table, and then add the table to the headertemplate
of a control (DataGrid / DataList/ Repeater). However, now the able is
showed empty in the browser. Please post here if I have any
misunderstandings.

I remembered that I have answered this issue before. Did it not work? You
may want to send me an email (remove "online") attached your simplified
source code (.vb and .aspx) then I might be able to work out what the
problem is.

Here are some suggestions:

If the table is in a header template, we need use FindControl method to get
the correct reference to it.

For example, the table is in the headertemplate of a datagrid:

Dim TestTable As Table

Private Sub DataGrid1_ItemDataBound(ByVal sender As System.Object, ByVal e
As System.Web.UI.WebControls.DataGridItemEventArgs) Handles
DataGrid1.ItemDataBound
If e.Item.ItemType = ListItemType.Header Then
Dim ctrl As Control = e.Item.FindControl("MyTable")
If Not ctrl Is Nothing Then
TestTable = CType(ctrl, Table)
End If
End If
End Sub

Then we can add rows to TestTable.

Best regards,
Lewis

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| Content-Class: urn:content-classes:message
| From: "Sue" <Su*@ojd.state.or.us>
| Sender: "Sue" <Su*@ojd.state.or.us>
| Subject: No display of object - redux
| Date: Wed, 6 Aug 2003 14:54:25 -0700
| Lines: 88
| Message-ID: <03****************************@phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcNcZU1xYceLz7k2TpmROkkV96DLeg==
| Newsgroups: microsoft.public.dotnet.general
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:103772
| NNTP-Posting-Host: TK2MSFTNGXA14 10.40.1.166
| X-Tomcat-NG: microsoft.public.dotnet.general
|
| Anyone have any ideas on why the code below will show up
| in a browser's sourcecode as an empty table, and is not
| visible?
|
| aspx:
| <headertemplate>
|
| <asp:Table ID="MyTable" runat="server" />
|
| </headertemplate>
|
| codebehind:
| Class MyClass....
|
| Protected WithEvents CaseTypeHeaderTable As
| System.Web.UI.WebControls.Table = New
| System.Web.UI.WebControls.Table
| Protected WithEvents CaseTypeSortButton As
| System.Web.UI.WebControls.Button = New
| System.Web.UI.WebControls.Button
| Protected WithEvents CaseTypeFilterDropDown As
| System.Web.UI.WebControls.DropDownList = New
| System.Web.UI.WebControls.DropDownList
| Protected WithEvents CaseTypeHRow1 As
| System.Web.UI.WebControls.TableRow = New
| System.Web.UI.WebControls.TableRow
| Protected WithEvents CaseTypeHRow2 As
| System.Web.UI.WebControls.TableRow = New
| System.Web.UI.WebControls.TableRow
| Protected WithEvents CaseTypeHCell1 As
| System.Web.UI.WebControls.TableCell = New
| System.Web.UI.WebControls.TableCell
| Protected WithEvents CaseTypeHCell2 As
| System.Web.UI.WebControls.TableCell = New
| System.Web.UI.WebControls.TableCell
|
|
| private sub Page_Load.....
| call setMyTable()
| end sub
|
| Private Sub setMyTable()
| With Me.MySortButton
| .BackColor = Color.Maroon
| .ForeColor = Color.White
| .ID = "MySortButton"
| .Text = "Sort This Column"
| .ToolTip = "Click to sort this column"
| .EnableViewState = True
| End With
|
| With Me.MyFilterBox
| .ID = "MyFilterBox"
| .ToolTip = "Enter value on which to filter records
| and press [ENTER]. To show all records clear the box and
| press [ENTER]."
| .EnableViewState = True
| End With
|
| With Me.MyCell1
| .VerticalAlign = VerticalAlign.Bottom
| .HorizontalAlign = HorizontalAlign.Center
| .Controls.Add(Me.MySortButton)
| End With
|
| With Me.MyCell2
| .HorizontalAlign = HorizontalAlign.Center
| .VerticalAlign = VerticalAlign.Top
| .Controls.Add(Me.MyFilterBox)
| End With
|
| With Me.MyRow1
| .Cells.Add(Me.MyCell1)
| End With
|
| With Me.MyRow2
| .Cells.Add(Me.MyCell2)
| End With
|
| With Me.MyTable
| .Rows.Add(Me.MyRow1)
| .Rows.Add(Me.MyRow2)
| End With
| End Sub
| End Class
|
| tia for any help,
| Sue
|

Jul 19 '05 #2

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

Similar topics

1
by: FrankBooth | last post by:
Hello, I have a list of names, and when I click ona name I want the extar info to show and then I want to clcik and hide it again. I have the following HTML which works perfectly if I use one...
7
by: Stefan Finzel | last post by:
Hi, is there a way to change the display property on Windows Mobile 2003 SE Mobile/Pocket Internet Explorer? See following example. Please note: visibilty property has the same problem. Is...
1
by: Sue | last post by:
Anyone have any ideas on why the code below will show up in a browser's sourcecode as an empty table, and is not visible? aspx: <headertemplate> <asp:Table ID="MyTable" runat="server" /> ...
1
by: rbinington | last post by:
Hi, I am trying to write a DNN module that has the ability to insert articles into an article repository. I want the users to be able to move pages around and enter text into the FCKEditor. I...
3
by: sherifffruitfly | last post by:
Hi all, I've got a class with a private DataSet member, and a void display() method. The display() method is *supposed* to take the DataSet for the class (instance), new up a predefined for...
1
by: Bob | last post by:
Hi, Hope you can help me with this one. I'm at my wits end. I'm trying to create an intelligent edit-box like the excellent "Customer" one at the URL: ...
2
by: Lupus | last post by:
Hi, I've written a function in javascript to obtain content using AJAX. While AJAX is loading, I want to show a div which says "please wait while loading. This is a part of the function: ...
1
by: =?Utf-8?B?THluZGE=?= | last post by:
In my web app, I have two CSS - one for display and one for print. A small copywrite statement needs to print, but does not display on the ASPX page. The ID of the copywrite statement has DISPLAY:...
5
by: Academia | last post by:
(If you've seen this in the drawing NG, sorry. I inadvertently sent it there.) I have a listbox populated with Objects. The Class has a String field that ToString returns. I assume that...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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:
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
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...

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.