Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Controls in tabel

Reply
Thread Tools

Controls in tabel

 
 
anonymou
Guest
Posts: n/a
 
      06-14-2004
I am trying to loop in table to set all controls visible.
What is incorrect in my code?
Dim control As System.Web.UI.WebControls.WebControl
Dim Table1 As System.Web.UI.WebControls.Table
For Each control In Table1
control.Visible = True
Next
 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      06-14-2004
Should be rather For Each control In Table1.Controls. Note, that Controls
property gives your only child controls for the control. To get the full
list of controls use recursion.

Eliyahu

"anonymou" <> wrote in message
news:1c28301c4521a$8030ddd0$...
> I am trying to loop in table to set all controls visible.
> What is incorrect in my code?
> Dim control As System.Web.UI.WebControls.WebControl
> Dim Table1 As System.Web.UI.WebControls.Table
> For Each control In Table1
> control.Visible = True
> Next



 
Reply With Quote
 
 
 
 
anonymous
Guest
Posts: n/a
 
      06-14-2004
I get this error msg:'Object reference not set to an
instance of an object'
Below is my code :
Dim control As System.Web.UI.WebControls.WebControl
Dim Table1 As System.Web.UI.WebControls.Table
For Each control In Table1.Controls
control.Visible = True
Next
 
Reply With Quote
 
Eliyahu Goldin
Guest
Posts: n/a
 
      06-15-2004
Dim is a declaration statement. It just declares variable Table1. You need
to instantiate it.

Eliyahu

"anonymous" <> wrote in message
news:1c31901c45230$985b88e0$...
> I get this error msg:'Object reference not set to an
> instance of an object'
> Below is my code :
> Dim control As System.Web.UI.WebControls.WebControl
> Dim Table1 As System.Web.UI.WebControls.Table
> For Each control In Table1.Controls
> control.Visible = True
> Next



 
Reply With Quote
 
Eliyahu Goldin
Guest
Posts: n/a
 
      06-15-2004
Dim is a declaration statement. It just declares variable Table1. You need
to instantiate it.

Eliyahu

"anonymous" <> wrote in message
news:1c31901c45230$985b88e0$...
> I get this error msg:'Object reference not set to an
> instance of an object'
> Below is my code :
> Dim control As System.Web.UI.WebControls.WebControl
> Dim Table1 As System.Web.UI.WebControls.Table
> For Each control In Table1.Controls
> control.Visible = True
> Next



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
request.getSession().getAttribute miss a row of data in tabel hon123456 Java 0 11-04-2011 09:46 AM
ASP.Net tabel nested in another ASP.Net table =?Utf-8?B?SmltUQ==?= ASP .Net 2 03-23-2007 05:14 AM
Tabel cells Jim McGivney ASP .Net 1 11-26-2005 12:06 AM
Tabel Cell gmalai ASP .Net 2 01-29-2005 07:17 PM
tabel as treenode in a treeview Ben Kawet ASP .Net Web Controls 1 09-19-2003 03:08 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57