473,770 Members | 2,719 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 CaseTypeHeaderT able As
System.Web.UI.W ebControls.Tabl e = New
System.Web.UI.W ebControls.Tabl e
Protected WithEvents CaseTypeSortBut ton As
System.Web.UI.W ebControls.Butt on = New
System.Web.UI.W ebControls.Butt on
Protected WithEvents CaseTypeFilterD ropDown As
System.Web.UI.W ebControls.Drop DownList = New
System.Web.UI.W ebControls.Drop DownList
Protected WithEvents CaseTypeHRow1 As
System.Web.UI.W ebControls.Tabl eRow = New
System.Web.UI.W ebControls.Tabl eRow
Protected WithEvents CaseTypeHRow2 As
System.Web.UI.W ebControls.Tabl eRow = New
System.Web.UI.W ebControls.Tabl eRow
Protected WithEvents CaseTypeHCell1 As
System.Web.UI.W ebControls.Tabl eCell = New
System.Web.UI.W ebControls.Tabl eCell
Protected WithEvents CaseTypeHCell2 As
System.Web.UI.W ebControls.Tabl eCell = New
System.Web.UI.W ebControls.Tabl eCell
private sub Page_Load.....
call setMyTable()
end sub

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

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

With Me.MyCell1
.VerticalAlign = VerticalAlign.B ottom
.HorizontalAlig n = HorizontalAlign .Center
.Controls.Add(M e.MySortButton)
End With

With Me.MyCell2
.HorizontalAlig n = HorizontalAlign .Center
.VerticalAlign = VerticalAlign.T op
.Controls.Add(M e.MyFilterBox)
End With

With Me.MyRow1
.Cells.Add(Me.M yCell1)
End With

With Me.MyRow2
.Cells.Add(Me.M yCell2)
End With

With Me.MyTable
.Rows.Add(Me.My Row1)
.Rows.Add(Me.My Row2)
End With
End Sub
End Class

tia for any help,
Sue
Jul 19 '05 #1
1 1960
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
misunderstandin gs.

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_ItemD ataBound(ByVal sender As System.Object, ByVal e
As System.Web.UI.W ebControls.Data GridItemEventAr gs) Handles
DataGrid1.ItemD ataBound
If e.Item.ItemType = ListItemType.He ader Then
Dim ctrl As Control = e.Item.FindCont rol("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: AcNcZU1xYceLz7k 2TpmROkkV96DLeg ==
| Newsgroups: microsoft.publi c.dotnet.genera l
| Path: cpmsftngxa06.ph x.gbl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.genera l:103772
| NNTP-Posting-Host: TK2MSFTNGXA14 10.40.1.166
| X-Tomcat-NG: microsoft.publi c.dotnet.genera l
|
| 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 CaseTypeHeaderT able As
| System.Web.UI.W ebControls.Tabl e = New
| System.Web.UI.W ebControls.Tabl e
| Protected WithEvents CaseTypeSortBut ton As
| System.Web.UI.W ebControls.Butt on = New
| System.Web.UI.W ebControls.Butt on
| Protected WithEvents CaseTypeFilterD ropDown As
| System.Web.UI.W ebControls.Drop DownList = New
| System.Web.UI.W ebControls.Drop DownList
| Protected WithEvents CaseTypeHRow1 As
| System.Web.UI.W ebControls.Tabl eRow = New
| System.Web.UI.W ebControls.Tabl eRow
| Protected WithEvents CaseTypeHRow2 As
| System.Web.UI.W ebControls.Tabl eRow = New
| System.Web.UI.W ebControls.Tabl eRow
| Protected WithEvents CaseTypeHCell1 As
| System.Web.UI.W ebControls.Tabl eCell = New
| System.Web.UI.W ebControls.Tabl eCell
| Protected WithEvents CaseTypeHCell2 As
| System.Web.UI.W ebControls.Tabl eCell = New
| System.Web.UI.W ebControls.Tabl eCell
|
|
| private sub Page_Load.....
| call setMyTable()
| end sub
|
| Private Sub setMyTable()
| With Me.MySortButton
| .BackColor = Color.Maroon
| .ForeColor = Color.White
| .ID = "MySortButt on"
| .Text = "Sort This Column"
| .ToolTip = "Click to sort this column"
| .EnableViewStat e = True
| End With
|
| With Me.MyFilterBox
| .ID = "MyFilterBo x"
| .ToolTip = "Enter value on which to filter records
| and press [ENTER]. To show all records clear the box and
| press [ENTER]."
| .EnableViewStat e = True
| End With
|
| With Me.MyCell1
| .VerticalAlign = VerticalAlign.B ottom
| .HorizontalAlig n = HorizontalAlign .Center
| .Controls.Add(M e.MySortButton)
| End With
|
| With Me.MyCell2
| .HorizontalAlig n = HorizontalAlign .Center
| .VerticalAlign = VerticalAlign.T op
| .Controls.Add(M e.MyFilterBox)
| End With
|
| With Me.MyRow1
| .Cells.Add(Me.M yCell1)
| End With
|
| With Me.MyRow2
| .Cells.Add(Me.M yCell2)
| End With
|
| With Me.MyTable
| .Rows.Add(Me.My Row1)
| .Rows.Add(Me.My Row2)
| 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
2672
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 construct, but if I use more that one it issues an object error which states that: ExpCollTxt_ctrl_ex.style is not an object. So the followin piece works fine:
7
6060
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 there any other way to display/undisplay parts of web pages? TIA
1
274
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" /> </headertemplate>
1
4532
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 want only one instance of the FCKEditor on the screen at one time so I make tabs that the user can click and I store the values in variables behind the scenes. I change the CSS class on the link that is the currently selected one. I have a really...
3
1726
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 which has a DataGrid, slap the DataSet onto the DataGrid, and set the form.visible to true. I'm having trouble with a very early part of the process. The first
1
4953
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: http://munich.schwarz-interactive.de/autocomplete.aspx
2
1714
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: z.style.display = "none"; y.style.display = "block"; ajax = new AjaxHandler;
1
1490
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: NONE in the Display.CSS and it does not appear on the page. However, I cannot get this statement to print even though my Print.CSS has this object defined to print. I would appreciate suggestions on how to define this in CSS so that the object...
5
2854
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 is what the ListBox uses for its display. Correct?
0
9453
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10036
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9904
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8929
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7451
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6710
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5481
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.