Expand/Collapse table row from hyperlink click

Discussion in 'ASP .Net' started by moondaddy, Mar 12, 2007.

  1. moondaddy

    moondaddy Guest

    Using asp.net 2.0 and c#, I have a table in a webform. One of the rows in
    the table has some text used as a main category heading. I want to be able
    to click on this heading and display or hide the row under it (similar to
    expanding nodes in a tree). How can I do this all client side? I was
    thinking of having the heading text look like a hyperlink so it would be
    intuitive for users to click on the link to see the row below.

    Thanks.

    --
    ail
     
    moondaddy, Mar 12, 2007
    #1
    1. Advertising

  2. moondaddy

    Mark Rae Guest

    "moondaddy" <> wrote in message
    news:...

    > Using asp.net 2.0 and c#, I have a table in a webform. One of the rows in
    > the table has some text used as a main category heading. I want to be
    > able to click on this heading and display or hide the row under it
    > (similar to expanding nodes in a tree). How can I do this all client
    > side? I was thinking of having the heading text look like a hyperlink so
    > it would be intuitive for users to click on the link to see the row below.


    Do you mean something like this: http://www.markrae.com/zzScratch/debug.aspx

    If so, just do a View Source and rip the JavaScript function...

    Although it ues buttons to toggle the visibility of entire tables, it would
    a very simple matter to modify it so that it uses hyperlinks to toggle the
    visibility of individual rows...
     
    Mark Rae, Mar 12, 2007
    #2
    1. Advertising

  3. Thanks for Mark's input.

    Hi Moondaddy,

    Normally, such show/hide functionality is implemented by client-side
    javascript, and you can use the html element's "display" css property to
    control whether it is show or hidden. Here are some additional web
    articles introducing how to implement such functionality:

    http://www.weberdev.com/get_example-4186.html

    http://www.aspcode.net/articles/l_en-US/t_default/ASP.NET/ASP.NET-2.0/Contro
    ls/Javascript---hide_show-multiple-table-rows_article_349.aspx

    If you have any more specific requirement here, please feel free to post
    here.

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Steven Cheng[MSFT], Mar 13, 2007
    #3
    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. Vaclav Jedlicka

    datagrid and border-collapse:collapse style

    Vaclav Jedlicka, Jun 26, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    5,947
    Yan-Hong Huang[MSFT]
    Jun 30, 2003
  2. jim
    Replies:
    0
    Views:
    563
  3. sekhar2cool
    Replies:
    0
    Views:
    766
    sekhar2cool
    Apr 14, 2008
  4. VVSRKS

    How can I avoid border-collapse:collapse to come ...

    VVSRKS, Sep 16, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    200
    VVSRKS
    Sep 16, 2004
  5. M.L.
    Replies:
    9
    Views:
    299
Loading...

Share This Page