473,738 Members | 10,068 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Adding webcontrols.tab le to aspx - not rendering

Sue
On code-behind page:
(attributes set programatically for each of these elements)
linkbutton added to tablecell
textbox added to tablecell
tablecells added to tablerow
tablerow added to table (table.ID is TestTable)
On .aspx page:
<HeaderTemplate >
<asp:Table ID="TestTable" runat="Server" />
</HeaderTemplate>

Source code on .aspx page in browser shows the table and it's controls are
correctly created and placed. Controls for the Linkbutton and Textbox do
not display in browser. I suspect it has something to do with the
runat="server" attribute for the linkbutton or textbox for which I do not
find an attribute I can set (e.g. linkbutton.runa t = "server"). Any ideas
on how I can get these elements to display?

tia,
Sue W.

Jul 19 '05 #1
5 5285
Hi Sue,

This problem doesn't occur to the following code snippet. Does it work on
your side? If so, you may want to show me the code snippet on your side so
that I can test it. Thanks.

private void Page_Load(objec t sender, System.EventArg s e)
{
int numrows = 3;
int numcells = 2;
for (int j=0; j<numrows; j++)
{
TableRow r = new TableRow();
for (int i=0; i<numcells; i++)
{
TableCell c = new TableCell();
LinkButton lb=new LinkButton ();

lb.Text=i.ToStr ing();
if(i==0)c.Contr ols.Add(lb);
else c.Controls.Add( new TextBox());
r.Cells.Add(c);
}
Table1.Rows.Add (r);
}
}

Best Regards,
Lewis Wang
Support Professional

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| MIME-Version: 1.0
| X-MIMETrack: Serialize by Notes Client on Susan L WILLIS/MUL/OJD(Release
6.0.1|February
| 07, 2003) at 07/23/2003 11:45:57 AM,
| Serialize complete at 07/23/2003 11:45:57 AM,
| Serialize by Notes Client on Susan L WILLIS/MUL/OJD(Release
6.0.1|February
| 07, 2003) at 07/23/2003 11:46:02 AM,
| Serialize complete at 07/23/2003 11:46:02 AM
| From: Su*@ojd.state.o r.us
| Subject: Adding webcontrols.tab le to aspx - not rendering
| X-Newsreader: Lotus Notes Release 6.0.1 February 07, 2003
| Content-Type: text/plain; charset="US-ASCII"
| Message-ID: <#T************ **@TK2MSFTNGP09 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.genera l
| Date: Wed, 23 Jul 2003 11:46:03 -0700
| NNTP-Posting-Host: 159.121.96.200
| Lines: 1
| Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP09.phx.g bl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.genera l:102197
| X-Tomcat-NG: microsoft.publi c.dotnet.genera l
|
| On code-behind page:
| (attributes set programatically for each of these elements)
| linkbutton added to tablecell
| textbox added to tablecell
| tablecells added to tablerow
| tablerow added to table (table.ID is TestTable)
| On .aspx page:
| <HeaderTemplate >
| <asp:Table ID="TestTable" runat="Server" />
| </HeaderTemplate>
|
| Source code on .aspx page in browser shows the table and it's controls
are
| correctly created and placed. Controls for the Linkbutton and Textbox do
| not display in browser. I suspect it has something to do with the
| runat="server" attribute for the linkbutton or textbox for which I do not
| find an attribute I can set (e.g. linkbutton.runa t = "server"). Any ideas
| on how I can get these elements to display?
|
| tia,
| Sue W.
|
|

Jul 19 '05 #2
Hi Sue,

Thank you for your feedback.

Do you want to add a textbox and a linkbutton into table programmingly,
then put the table into a HeaderTemplate of datagrid's column? The
following code snippet demonstrates this.

If I misunderstood your concern, would you please provide more explanations
on your requirement? Thank you.

Dim CaseNumberHeade rTable 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
CaseNumberHeade rTable =
CType(e.Item.Fi ndControl("Case NumberHeaderTab le"), Table)
setCaseNumberHe aderTable()
End If

End Sub

Private Sub setCaseNumberHe aderTable()

Dim CaseNumberHRow1 As TableRow = New TableRow
Dim CaseNumberHRow2 As TableRow = New TableRow
Dim CaseNumberHCell 1 As TableCell = New TableCell
Dim CaseNumberHCell 2 As TableCell = New TableCell

Dim CaseNumberSortB utton As LinkButton = New LinkButton
Dim CaseNumberFilte rBox As TextBox = New TextBox

CaseNumberSortB utton.ID = "CaseNumberSort Button"
CaseNumberSortB utton.Text = "Sort CaseNo"
CaseNumberSortB utton.ToolTip = "Click to sort the case number
column"

CaseNumberFilte rBox.ID = "CaseNumberFilt erBox"
CaseNumberFilte rBox.ToolTip = "Enter case number on which to filter
records"

CaseNumberHCell 1.VerticalAlign = VerticalAlign.B ottom
CaseNumberHCell 1.HorizontalAli gn = HorizontalAlign .Center
CaseNumberHCell 1.Controls.Add( CaseNumberSortB utton)

CaseNumberHCell 2.VerticalAlign = VerticalAlign.T op
CaseNumberHCell 2.Text = "Filter by: <BR><HR><BR>"
CaseNumberHCell 2.Controls.Add( CaseNumberFilte rBox)
CaseNumberHRow1 .Controls.Add(C aseNumberHCell1 )
CaseNumberHRow2 .Controls.Add(C aseNumberHCell2 )
CaseNumberHeade rTable.Controls .Add(CaseNumber HRow1)
CaseNumberHeade rTable.Controls .Add(CaseNumber HRow2)
CaseNumberHeade rTable.ID = "CaseNumberHead erTable"
CaseNumberHeade rTable.BorderCo lor = Color.Blue
End Sub
Lewis Wang

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>
| References: <#T************ **@TK2MSFTNGP09 .phx.gbl>
<Dy************ **@cpmsftngxa06 .phx.gbl>
| Subject: RE: Adding webcontrols.tab le to aspx - not rendering
| Date: Thu, 24 Jul 2003 11:38:45 -0700
| Lines: 87
| Message-ID: <01************ *************** *@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: AcNSEtCmGhmPnX8 ZQxeVikG/sDAnmg==
| Newsgroups: microsoft.publi c.dotnet.genera l
| Path: cpmsftngxa06.ph x.gbl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.genera l:102328
| NNTP-Posting-Host: TK2MSFTNGXA12 10.40.1.164
| X-Tomcat-NG: microsoft.publi c.dotnet.genera l
|
| >your side? If so, you may want to show me the code
| snippet on your side so
| >that I can test it. Thanks.
|
| Lewis, tried your code, but I'm working in VB and
| couldn't remember half of how to get things set up for C
| (#?). I do have a similar table working just find
| further up in the web page. It's not part of a datagrid
| though. Below is the relevant code for this problem.
|
| Protected WithEvents CaseNumberSortB utton As LinkButton =
| LinkButton
| Protected WithEvents CaseNumberFilte rBox As TextBox = New
| TextBox
| Protected WithEvents CaseNumberHeade rTable As Table = New
| Table
| Protected WithEvents CaseNumberHRow1 As TableRow = New
| TableRow
| Protected WithEvents CaseNumberHRow2 As TableRow = New
| TableRow
| Protected WithEvents CaseNumberHCell 1 As TableCell = New
| TableCell
| Protected WithEvents CaseNumberHCell 2 As TableCell = New
| TableCell
|
| Private Sub Page_Load(ByVal sender As System.Object,
| ByVal e As System.EventArg s) Handles MyBase.Load
| Call setCaseNumberHe aderTable()
| End Sub
|
| Public Sub setCaseNumberHe aderTable()
| With CaseNumberSortB utton
| .ID = "CaseNumberSort Button"
| .Text = "Sort CaseNo"
| .ToolTip = "Click to sort the case number column"
| End With
| With CaseNumberFilte rBox
| .ID = "CaseNumberFilt erBox"
| .ToolTip = "Enter case number on which to filter
| records"
| End With
| With Me.CaseNumberHC ell1
| .VerticalAlign = VerticalAlign.B ottom
| .HorizontalAlig n = HorizontalAlign .Center
| .Controls.Add(C aseNumberSortBu tton)
| End With
| With CaseNumberHCell 2
| .VerticalAlign = VerticalAlign.T op
| .Text = "Filter by: <BR><HR><BR>"
| .Controls.Add(C aseNumberFilter Box)
| End With
| With Me.CaseNumberHR ow1
| .Controls.Add(C aseNumberHCell1 )
| End With
| With CaseNumberHRow2
| .Controls.Add(C aseNumberHCell2 )
| End With
| With CaseNumberHeade rTable
| .Controls.Add(C aseNumberHRow1)
| .Controls.Add(C aseNumberHRow2)
| .ID = "CaseNumberHead erTable"
| .Width.Percenta ge(100)
| End With
| End Sub
|
| .aspx file:
|
| <asp:datagrid id=DG runat="server">
| <Columns>
| <asp:TemplateCo lumn SortExpression= "CaseNo">
| <HeaderTemplate >
| <asp:Table ID="CaseNumberH eaderTable"
| Runat="Server" />
| </HeaderTemplate>
| ......
| </asp:TemplateCol umn>
| </Columns>
| </asp:Datagrid>
|
| Any help appreciated...
|
| Sue
|
|
|
|
|
|

Jul 19 '05 #3
Sue
>If I misunderstood your concern, would you please
provide more explanations
on your requirement? Thank you.
This is exactly what I wish to do. I have tried the code
below (modified for my object names) and got an invalid
cast error message at the CType line. I know this is
simple, I'm just not tripping onto the correct syntax
<sigh>. I've tried various options for the CType without
success. Any other ideas?

tia,
Sue

Dim CaseNumberHeade rTable As Table

Private Sub DataGrid1_ItemD ataBound(ByVal sender As System.Object, ByVal eAs System.Web.UI.W ebControls.Data GridItemEventAr gs) HandlesDataGrid1.Item DataBound
If e.Item.ItemType = ListItemType.He ader Then
CaseNumberHeade rTable =
CType(e.Item.F indControl("Cas eNumberHeaderTa ble"), Table)
setCaseNumberHe aderTable()
End If

End Sub

Private Sub setCaseNumberHe aderTable()

Dim CaseNumberHRow1 As TableRow = New TableRow
Dim CaseNumberHRow2 As TableRow = New TableRow
Dim CaseNumberHCell 1 As TableCell = New TableCell
Dim CaseNumberHCell 2 As TableCell = New TableCell

Dim CaseNumberSortB utton As LinkButton = New LinkButton Dim CaseNumberFilte rBox As TextBox = New TextBox

CaseNumberSortB utton.ID = "CaseNumberSort Button"
CaseNumberSortB utton.Text = "Sort CaseNo"
CaseNumberSortB utton.ToolTip = "Click to sort the case numbercolumn"

CaseNumberFilte rBox.ID = "CaseNumberFilt erBox"
CaseNumberFilte rBox.ToolTip = "Enter case number on which to filterrecords"

CaseNumberHCell 1.VerticalAlign = VerticalAlign.B ottom CaseNumberHCell 1.HorizontalAli gn = HorizontalAlign .Center CaseNumberHCell 1.Controls.Add (CaseNumberSort Button)
CaseNumberHCell 2.VerticalAlign = VerticalAlign.T op CaseNumberHCell 2.Text = "Filter by: <BR><HR><BR>"
CaseNumberHCell 2.Controls.Add (CaseNumberFilt erBox) CaseNumberHRow1 .Controls.Add(C aseNumberHCell1 )
CaseNumberHRow2 .Controls.Add(C aseNumberHCell2 )
CaseNumberHeade rTable.Controls .Add (CaseNumberHRow 1) CaseNumberHeade rTable.Controls .Add (CaseNumberHRow 2) CaseNumberHeade rTable.ID = "CaseNumberHead erTable" CaseNumberHeade rTable.BorderCo lor = Color.Blue
End Sub
Lewis Wang

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>
| References: <#T************ **@TK2MSFTNGP09 .phx.gbl>
<Dy*********** ***@cpmsftngxa0 6.phx.gbl>
| Subject: RE: Adding webcontrols.tab le to aspx - not rendering| Date: Thu, 24 Jul 2003 11:38:45 -0700
| Lines: 87
| Message-ID: <01************ *************** *@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: AcNSEtCmGhmPnX8 ZQxeVikG/sDAnmg==
| Newsgroups: microsoft.publi c.dotnet.genera l
| Path: cpmsftngxa06.ph x.gbl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.genera l:102328| NNTP-Posting-Host: TK2MSFTNGXA12 10.40.1.164
| X-Tomcat-NG: microsoft.publi c.dotnet.genera l
|
| >your side? If so, you may want to show me the code
| snippet on your side so
| >that I can test it. Thanks.
|
| Lewis, tried your code, but I'm working in VB and
| couldn't remember half of how to get things set up for C| (#?). I do have a similar table working just find
| further up in the web page. It's not part of a datagrid| though. Below is the relevant code for this problem.
|
| Protected WithEvents CaseNumberSortB utton As LinkButton =| LinkButton
| Protected WithEvents CaseNumberFilte rBox As TextBox = New| TextBox
| Protected WithEvents CaseNumberHeade rTable As Table = New| Table
| Protected WithEvents CaseNumberHRow1 As TableRow = New
| TableRow
| Protected WithEvents CaseNumberHRow2 As TableRow = New
| TableRow
| Protected WithEvents CaseNumberHCell 1 As TableCell = New| TableCell
| Protected WithEvents CaseNumberHCell 2 As TableCell = New| TableCell
|
| Private Sub Page_Load(ByVal sender As System.Object,
| ByVal e As System.EventArg s) Handles MyBase.Load
| Call setCaseNumberHe aderTable()
| End Sub
|
| Public Sub setCaseNumberHe aderTable()
| With CaseNumberSortB utton
| .ID = "CaseNumberSort Button"
| .Text = "Sort CaseNo"
| .ToolTip = "Click to sort the case number column"
| End With
| With CaseNumberFilte rBox
| .ID = "CaseNumberFilt erBox"
| .ToolTip = "Enter case number on which to filter
| records"
| End With
| With Me.CaseNumberHC ell1
| .VerticalAlign = VerticalAlign.B ottom
| .HorizontalAlig n = HorizontalAlign .Center
| .Controls.Add(C aseNumberSortBu tton)
| End With
| With CaseNumberHCell 2
| .VerticalAlign = VerticalAlign.T op
| .Text = "Filter by: <BR><HR><BR>"
| .Controls.Add(C aseNumberFilter Box)
| End With
| With Me.CaseNumberHR ow1
| .Controls.Add(C aseNumberHCell1 )
| End With
| With CaseNumberHRow2
| .Controls.Add(C aseNumberHCell2 )
| End With
| With CaseNumberHeade rTable
| .Controls.Add(C aseNumberHRow1)
| .Controls.Add(C aseNumberHRow2)
| .ID = "CaseNumberHead erTable"
| .Width.Percenta ge(100)
| End With
| End Sub
|
| .aspx file:
|
| <asp:datagrid id=DG runat="server">
| <Columns>
| <asp:TemplateCo lumn SortExpression= "CaseNo">
| <HeaderTemplate >
| <asp:Table ID="CaseNumberH eaderTable"
| Runat="Server" />
| </HeaderTemplate>
| ......
| </asp:TemplateCol umn>
| </Columns>
| </asp:Datagrid>
|
| Any help appreciated...
|
| Sue
|
|
|
|
|
|

.

Jul 19 '05 #4
Hi Sue,

The Type should be the same as control's type <asp:Table
ID="CaseNumberH eaderTable" Runat="Server" />. Otherwise, there will be an
error. If FindControl menthod returns nothing, there will also be an error.
You can use code similar to the following to perform the cast.

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("CaseNumber HeaderTable")
If Not ctrl Is Nothing Then
CaseNumberHeade rTable = CType(ctrl, Table)
setCaseNumberHe aderTable()
End If
End If

End Sub

Please let know if it helps. Thanks.

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>
| References: <#T************ **@TK2MSFTNGP09 .phx.gbl>
<Dy************ **@cpmsftngxa06 .phx.gbl>
<01************ *************** *@phx.gbl>
<Ip************ **@cpmsftngxa06 .phx.gbl>
| Subject: RE: Adding webcontrols.tab le to aspx - not rendering
| Date: Mon, 28 Jul 2003 10:03:35 -0700
| Lines: 204
| Message-ID: <33************ *************** *@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: AcNVKi7XO2W/Wc7XRJSgT85DFF8 sFw==
| Newsgroups: microsoft.publi c.dotnet.genera l
| Path: cpmsftngxa06.ph x.gbl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.genera l:102600
| NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
| X-Tomcat-NG: microsoft.publi c.dotnet.genera l
|
| >If I misunderstood your concern, would you please
| provide more explanations
| >on your requirement? Thank you.
|
| This is exactly what I wish to do. I have tried the code
| below (modified for my object names) and got an invalid
| cast error message at the CType line. I know this is
| simple, I'm just not tripping onto the correct syntax
| <sigh>. I've tried various options for the CType without
| success. Any other ideas?
|
| tia,
| Sue
|
| >
| >Dim CaseNumberHeade rTable 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.Item DataBound
| > If e.Item.ItemType = ListItemType.He ader Then
| > CaseNumberHeade rTable =
| >CType(e.Item.F indControl("Cas eNumberHeaderTa ble"), Table)
| > setCaseNumberHe aderTable()
| > End If
| >
| > End Sub
| >
| >Private Sub setCaseNumberHe aderTable()
| >
| > Dim CaseNumberHRow1 As TableRow = New TableRow
| > Dim CaseNumberHRow2 As TableRow = New TableRow
| > Dim CaseNumberHCell 1 As TableCell = New TableCell
| > Dim CaseNumberHCell 2 As TableCell = New TableCell
| >
| > Dim CaseNumberSortB utton As LinkButton = New
| LinkButton
| > Dim CaseNumberFilte rBox As TextBox = New TextBox
| >
| > CaseNumberSortB utton.ID = "CaseNumberSort Button"
| > CaseNumberSortB utton.Text = "Sort CaseNo"
| > CaseNumberSortB utton.ToolTip = "Click to sort
| the case number
| >column"
| >
| > CaseNumberFilte rBox.ID = "CaseNumberFilt erBox"
| > CaseNumberFilte rBox.ToolTip = "Enter case number
| on which to filter
| >records"
| >
| > CaseNumberHCell 1.VerticalAlign =
| VerticalAlign.B ottom
| > CaseNumberHCell 1.HorizontalAli gn =
| HorizontalAlign .Center
| > CaseNumberHCell 1.Controls.Add
| (CaseNumberSort Button)
| >
| > CaseNumberHCell 2.VerticalAlign =
| VerticalAlign.T op
| > CaseNumberHCell 2.Text = "Filter by: <BR><HR><BR>"
| > CaseNumberHCell 2.Controls.Add
| (CaseNumberFilt erBox)
| > CaseNumberHRow1 .Controls.Add(C aseNumberHCell1 )
| > CaseNumberHRow2 .Controls.Add(C aseNumberHCell2 )
| > CaseNumberHeade rTable.Controls .Add
| (CaseNumberHRow 1)
| > CaseNumberHeade rTable.Controls .Add
| (CaseNumberHRow 2)
| > CaseNumberHeade rTable.ID
| = "CaseNumberHead erTable"
| > CaseNumberHeade rTable.BorderCo lor = Color.Blue
| > End Sub
| >
| >
| >Lewis Wang
| >
| >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>
| >| References: <#T************ **@TK2MSFTNGP09 .phx.gbl>
| ><Dy*********** ***@cpmsftngxa0 6.phx.gbl>
| >| Subject: RE: Adding webcontrols.tab le to aspx - not
| rendering
| >| Date: Thu, 24 Jul 2003 11:38:45 -0700
| >| Lines: 87
| >| Message-ID: <01************ *************** *@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: AcNSEtCmGhmPnX8 ZQxeVikG/sDAnmg==
| >| Newsgroups: microsoft.publi c.dotnet.genera l
| >| Path: cpmsftngxa06.ph x.gbl
| >| Xref: cpmsftngxa06.ph x.gbl
| microsoft.publi c.dotnet.genera l:102328
| >| NNTP-Posting-Host: TK2MSFTNGXA12 10.40.1.164
| >| X-Tomcat-NG: microsoft.publi c.dotnet.genera l
| >|
| >| >your side? If so, you may want to show me the code
| >| snippet on your side so
| >| >that I can test it. Thanks.
| >|
| >| Lewis, tried your code, but I'm working in VB and
| >| couldn't remember half of how to get things set up for
| C
| >| (#?). I do have a similar table working just find
| >| further up in the web page. It's not part of a
| datagrid
| >| though. Below is the relevant code for this problem.
| >|
| >| Protected WithEvents CaseNumberSortB utton As
| LinkButton =
| >| LinkButton
| >| Protected WithEvents CaseNumberFilte rBox As TextBox =
| New
| >| TextBox
| >| Protected WithEvents CaseNumberHeade rTable As Table =
| New
| >| Table
| >| Protected WithEvents CaseNumberHRow1 As TableRow = New
| >| TableRow
| >| Protected WithEvents CaseNumberHRow2 As TableRow = New
| >| TableRow
| >| Protected WithEvents CaseNumberHCell 1 As TableCell =
| New
| >| TableCell
| >| Protected WithEvents CaseNumberHCell 2 As TableCell =
| New
| >| TableCell
| >|
| >| Private Sub Page_Load(ByVal sender As System.Object,
| >| ByVal e As System.EventArg s) Handles MyBase.Load
| >| Call setCaseNumberHe aderTable()
| >| End Sub
| >|
| >| Public Sub setCaseNumberHe aderTable()
| >| With CaseNumberSortB utton
| >| .ID = "CaseNumberSort Button"
| >| .Text = "Sort CaseNo"
| >| .ToolTip = "Click to sort the case number column"
| >| End With
| >| With CaseNumberFilte rBox
| >| .ID = "CaseNumberFilt erBox"
| >| .ToolTip = "Enter case number on which to filter
| >| records"
| >| End With
| >| With Me.CaseNumberHC ell1
| >| .VerticalAlign = VerticalAlign.B ottom
| >| .HorizontalAlig n = HorizontalAlign .Center
| >| .Controls.Add(C aseNumberSortBu tton)
| >| End With
| >| With CaseNumberHCell 2
| >| .VerticalAlign = VerticalAlign.T op
| >| .Text = "Filter by: <BR><HR><BR>"
| >| .Controls.Add(C aseNumberFilter Box)
| >| End With
| >| With Me.CaseNumberHR ow1
| >| .Controls.Add(C aseNumberHCell1 )
| >| End With
| >| With CaseNumberHRow2
| >| .Controls.Add(C aseNumberHCell2 )
| >| End With
| >| With CaseNumberHeade rTable
| >| .Controls.Add(C aseNumberHRow1)
| >| .Controls.Add(C aseNumberHRow2)
| >| .ID = "CaseNumberHead erTable"
| >| .Width.Percenta ge(100)
| >| End With
| >| End Sub
| >|
| >| .aspx file:
| >|
| >| <asp:datagrid id=DG runat="server">
| >| <Columns>
| >| <asp:TemplateCo lumn SortExpression= "CaseNo">
| >| <HeaderTemplate >
| >| <asp:Table ID="CaseNumberH eaderTable"
| >| Runat="Server" />
| >| </HeaderTemplate>
| >| ......
| >| </asp:TemplateCol umn>
| >| </Columns>
| >| </asp:Datagrid>
| >|
| >| Any help appreciated...
| >|
| >| Sue
| >|
| >|
| >|
| >|
| >|
| >|
| >
| >.
| >
|

Jul 19 '05 #5
Hi Sue,

I am glad to hear it. Thanks very much for participating the community.

Lewis

--------------------
| Content-Class: urn:content-classes:message
| From: "Sue" <Su*@ojd.state. or.us>
| Sender: "Sue" <Su*@ojd.state. or.us>
| References: <#T************ **@TK2MSFTNGP09 .phx.gbl>
<Dy************ **@cpmsftngxa06 .phx.gbl>
<01************ *************** *@phx.gbl>
<Ip************ **@cpmsftngxa06 .phx.gbl>
<33************ *************** *@phx.gbl>
<CF************ **@cpmsftngxa06 .phx.gbl>
| Subject: RE: Adding webcontrols.tab le to aspx - not rendering
| Date: Tue, 29 Jul 2003 08:41:29 -0700
| Lines: 12
| Message-ID: <00************ *************** *@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: AcNV5+DwpsTgGSI tQI60DEU5KS6ZWw ==
| Newsgroups: microsoft.publi c.dotnet.genera l
| Path: cpmsftngxa06.ph x.gbl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.genera l:102714
| NNTP-Posting-Host: TK2MSFTNGXA11 10.40.1.163
| X-Tomcat-NG: microsoft.publi c.dotnet.genera l
|
| Aha...in my HTML on the .aspx page, I had used
| <table...>. Once I changed it to <asp:table> things
| started working. Thanks for the help with this - I knew
| it was something simple that I just wasn't seeing. Live
| and learn.
|
| Sue
|
| >The Type should be the same as control's type <asp:Table
| >ID="CaseNumber HeaderTable" Runat="Server" />.
|
|
|

Jul 19 '05 #6

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

Similar topics

5
2594
by: martin | last post by:
Hi, I am using vb.net and visual studio 2003. I have dragged a table webcontrol onto the designer server and configured a few columns and cells in the editor for the table control. Next I wanted to do things like add textbox websever controls to the individual cells. However, the designer will not allow me to drag controls from the toolbox to tinside the newly generated table.
3
6172
by: DalePres | last post by:
I have an application that uses the Microsoft.Web.UI.WebControls.TabStrip and Multipage controls. When I test the app on my pc or on my client's development web servers the controls render properly. When I deploy the app to the test environment - supposedly an exact duplicate of the development environment - the TabStrip and Multipage controls do not render - the text of the tabs are displayed in a line, but no tabs. This is the same...
0
919
by: Mike James via .NET 247 | last post by:
Hi, I am using a WebControls.Table called MYTABLE on my asp.net page.I follow the methods to fill a WebControls.Table as outlined inmsdnhttp://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebuiwebcontrolstableclasstopic.asp. I also include a checkbox in each row. Everything looks fine hereand MyTable does fill up with cells and rows. When the user checks the box I want to be able to read that therow has...
13
1157
by: Sue | last post by:
On code-behind page: (attributes set programatically for each of these elements) linkbutton added to tablecell textbox added to tablecell tablecells added to tablerow tablerow added to table (table.ID is TestTable) On .aspx page: <HeaderTemplate> <asp:Table ID="TestTable" runat="Server" /> </HeaderTemplate>
10
1921
by: B. Chernick | last post by:
I am using a System.Web.UI.WebControls.Table control on a screen. (Dot Net 1.1) My problem is this: The table is programmatically reconstructed on every postback. Each table row contains two textboxes that are intially set from the database. None of the items in the table are 'databound'. As of now, if the previous instance of the screen contained data in the first row boxes, that data is carried over, even if the boxes text value...
2
1546
by: XD | last post by:
How to bind web.UI.webcontrols.Table in asp.net 2.0 to a DataView1? Please provide an example. Thanks, ___________________________________________________ NOTE ============================================== No it is not datatable. It is normal web.UI.webcontrols.Table I want to view the data in gridview1 than a table.
0
8969
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9476
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9263
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
8210
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...
0
4570
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
4825
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3279
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
2
2745
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.