Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Hide a row

Hide a row

Scheduled Pinned Locked Moved ASP.NET
tutorialquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MacIntyre
    wrote on last edited by
    #1

    Is it possible to hide (visible=false) a complete row of controls with 1 command? And can this be controlled from code-behind? If so, pleasee show example... Thanks in advance... Chuck...

    K J 2 Replies Last reply
    0
    • M MacIntyre

      Is it possible to hide (visible=false) a complete row of controls with 1 command? And can this be controlled from code-behind? If so, pleasee show example... Thanks in advance... Chuck...

      K Offline
      K Offline
      Kaushal Arora
      wrote on last edited by
      #2

      Yes, it is possible. Give the Row a id and make it runat="server" like

      <table>
      <tr id="rowhide" runat="server">
      <td>
      <asp:Label id="lbl" runat="server" Text="Test"></asp:Label>
      </td>
      <td>
      <asp:Label id="lbl2" runat="server" Text="Tes2"></asp:Label>
      </td>
      </tr>
      </table>

      And now at the code behind page you can do like rowhide.Visible = false; //true Hope it helps. Regards, Kaushal Arora

      M 1 Reply Last reply
      0
      • M MacIntyre

        Is it possible to hide (visible=false) a complete row of controls with 1 command? And can this be controlled from code-behind? If so, pleasee show example... Thanks in advance... Chuck...

        J Offline
        J Offline
        Jeneesh K Velayudhan
        wrote on last edited by
        #3

        Hi MacIntyre, Please specify which control you are using now ??? Most of the controls support this visiblity feature. You can use Fetchrowstyle(),OnItemDataBound() methods, only when you are using grids. datarow.visible is also possible. or, place these controls in a panel, after that manage the visibility of the panel. If you are using server tables you can manage it from code behind. But it would be memory consuming. So, dont try to use server controls, if possible :)

        Thanks & Regards, Jeneesh k. v.

        M 1 Reply Last reply
        0
        • K Kaushal Arora

          Yes, it is possible. Give the Row a id and make it runat="server" like

          <table>
          <tr id="rowhide" runat="server">
          <td>
          <asp:Label id="lbl" runat="server" Text="Test"></asp:Label>
          </td>
          <td>
          <asp:Label id="lbl2" runat="server" Text="Tes2"></asp:Label>
          </td>
          </tr>
          </table>

          And now at the code behind page you can do like rowhide.Visible = false; //true Hope it helps. Regards, Kaushal Arora

          M Offline
          M Offline
          MacIntyre
          wrote on last edited by
          #4

          Thanks Kaushal, I will try this out first thing in the morning and let you know. I think I tried something like this with out much results but I might not have included the runat=server in the tr statement. I'll let you know... Thanks again... Chuck...

          1 Reply Last reply
          0
          • J Jeneesh K Velayudhan

            Hi MacIntyre, Please specify which control you are using now ??? Most of the controls support this visiblity feature. You can use Fetchrowstyle(),OnItemDataBound() methods, only when you are using grids. datarow.visible is also possible. or, place these controls in a panel, after that manage the visibility of the panel. If you are using server tables you can manage it from code behind. But it would be memory consuming. So, dont try to use server controls, if possible :)

            Thanks & Regards, Jeneesh k. v.

            M Offline
            M Offline
            MacIntyre
            wrote on last edited by
            #5

            most of the rows are in a table and are things list dropdownlist, label and textbox. They are usually all within the same row or tr tags.. I actually want it to appear to non-managers as if there was never anything there, but to managers the row appears. Ex: To manager: Customer Name: John Doe Account Balance: $10.000 Account Standing: Excellant EX: to non-managers: Customer Name: John Doe Account Standing: Excellant So you see a non-manager would never know that the "Account Balance" row ever existed. If you have additional thoughts I would appreciate hearing them. CHeers.. Chuck...

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups