Hide / Show Details

Discussion in 'ASP .Net' started by =?Utf-8?B?R3JlZw==?=, Apr 14, 2005.

  1. Hello,

    I am trying to display order ids and order details (order items).
    I would like to give the user Hide/Show option to either display or hide
    order details.

    The page would look like:

    Expand All Collapse All

    ===================
    Order 1
    Hide Details
    Item 1
    Item 2
    Etc
    ===================

    ===================
    Order 2
    Show Details
    ===================

    Any ideas how to accomplish this (could it be done with client site code)?
    Thanks,
    =?Utf-8?B?R3JlZw==?=, Apr 14, 2005
    #1
    1. Advertising

  2. Hi Greg,
    There are a couple of ways to do this - essentially what you need is some
    JavaScript to set things to hidden or not.

    You could start with building a client side function something like:
    <script language="javascript">
    function setVisibleStatus(element)
    {
    if (document.all[element].style.display=="")
    {
    document.all[element].style.display=="none"
    }
    else
    {
    document.all[element].style.display=""
    }
    }
    </script>

    This function will toggle this supplied element id to shown or hidden.

    Then, as you are writing out your data you would need to add in hooks to
    this function. So, let's say you are using the DataGrid for this, in the
    ItemCreated event for the grid, you could use the
    control.Attributes.Add("onclick", "setVisibleStatus('tablerowid')"), or
    something similar.

    Hope this gives you a start ...
    Dave

    "Greg" wrote:

    > Hello,
    >
    > I am trying to display order ids and order details (order items).
    > I would like to give the user Hide/Show option to either display or hide
    > order details.
    >
    > The page would look like:
    >
    > Expand All Collapse All
    >
    > ===================
    > Order 1
    > Hide Details
    > Item 1
    > Item 2
    > Etc
    > ===================
    >
    > ===================
    > Order 2
    > Show Details
    > ===================
    >
    > Any ideas how to accomplish this (could it be done with client site code)?
    > Thanks,
    >
    >
    >
    =?Utf-8?B?RGF2ZSBCcml0dG9u?=, Apr 15, 2005
    #2
    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. Eitan
    Replies:
    2
    Views:
    336
    darrel
    Jan 6, 2004
  2. Michel Couche

    Datalist: "hide/show" more details

    Michel Couche, Feb 1, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    500
    Michel Couche
    Feb 1, 2006
  3. =?Utf-8?B?Sm9l?=

    Show Details/Hide Details link button

    =?Utf-8?B?Sm9l?=, Mar 13, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    904
    dkode
    Mar 13, 2006
  4. Ralph
    Replies:
    5
    Views:
    423
    Ralph
    Apr 25, 2008
  5. ll
    Replies:
    2
    Views:
    640
    Thomas 'PointedEars' Lahn
    May 1, 2008
Loading...

Share This Page