473,405 Members | 2,415 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Expand/Collapse table row from hyperlink click

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.

--
mo*******@noemail.noemail
Mar 12 '07 #1
2 12772
"moondaddy" <mo*******@noemail.noemailwrote in message
news:eT**************@TK2MSFTNGP04.phx.gbl...
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...
Mar 12 '07 #2
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...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.

Mar 13 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Randy Starkey | last post by:
Hi, Is there a way to expand and collapse all if I have multiple implementations of this script on a single page? The script works well individually. Thanks! --Randy Starkey ---
0
by: Shadow Lynx | last post by:
When using ASP.NET 2.0's built-in TreeView on a page with <BASE target = "AnythingBut_Self"></BASE> in the HEAD, the expand/collapse buttons fail to function. The reason for this is that the...
7
by: sirfunusa | last post by:
Does anyone have sample code for an expanding parent/child datagrid. Like a treeview control with the "+/-" signs. ASP.NET 1.1 thanks Jeff
2
by: sam | last post by:
Hi all, I have a series of divs in 2 blocks say BLOCK1 and BLOCK2 and I want to use one click to expand/collapse all those in each block. But the code I came up with exapands all the divs in the...
0
by: jim | last post by:
Hi, I have a TreeView control that sits on the MasterPage. All of my other webpages inherit from that Master Page. The Treeview receives it's data using an XMLDataSource that has it's DataFile...
0
by: Tor Inge Rislaa | last post by:
I need to expand/collapse TreeView nodes to show/hide childnodes by clikcing on the node text (instead of using the expand/collapse icon). Does anyone know how to do that? (What property has to be...
2
by: ihteerp05 | last post by:
Hi, I have a hyperlink and onClick of the hyperlink,i have written a javascript function to expand/collapse a table. But it works fine in my development box,but in the test box,if i click the...
0
by: Homer J. Simpson | last post by:
A few weeks ago I asked for suggestions on how to persist a tree's node state to cookies, without causing postbacks on each click in the tree. I had a single .aspx file, with a row of buttons on...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.