Controls in tabel

Discussion in 'ASP .Net Datagrid Control' started by anonymou, Jun 14, 2004.

  1. anonymou

    anonymou Guest

    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
    anonymou, Jun 14, 2004
    #1
    1. Advertising

  2. 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
    Eliyahu Goldin, Jun 14, 2004
    #2
    1. Advertising

  3. anonymou

    anonymous Guest

    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
    anonymous, Jun 14, 2004
    #3
  4. 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
    Eliyahu Goldin, Jun 15, 2004
    #4
  5. 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
    Eliyahu Goldin, Jun 15, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. gmalai

    Tabel Cell

    gmalai, Jan 28, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    487
    gmalai
    Jan 29, 2005
  2. Jim McGivney

    Tabel cells

    Jim McGivney, Nov 25, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    461
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
    Nov 26, 2005
  3. =?Utf-8?B?SmltUQ==?=

    ASP.Net tabel nested in another ASP.Net table

    =?Utf-8?B?SmltUQ==?=, Mar 23, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    1,718
    =?Utf-8?B?SmltUQ==?=
    Mar 23, 2007
  4. Ben Kawet

    tabel as treenode in a treeview

    Ben Kawet, Sep 18, 2003, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    152
    Alvin Bruney
    Sep 19, 2003
  5. hon123456
    Replies:
    0
    Views:
    633
    hon123456
    Nov 4, 2011
Loading...

Share This Page