Hide / Show Details

G

Guest

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,
 
G

Guest

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top