473,404 Members | 2,178 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,404 software developers and data experts.

hiding table rows by id?

I'm trying to have a table that I can selectively hide or show it's rows
depending on some data in a database.
I see that I can refer to a row by index and toggle it's visible
property that way (mytable.rows(0).visible = false), but I may not
always know the order of rows so I'd love to be able to refer to a row
by id. It appears that can't be done the way I was trying, but is there
another alternative or workaround to do what I'd like?

I want to be able to have a row in an unknown position selectively shown
or hidden. Any hints or suggestions would be appreciated!

One thought I'll try now: Can I loop through the rows collection, check
id's, and then show/hide by current index?

Thanks!

Matt
Nov 19 '05 #1
2 5270
Is this server side or client side?

Assume your rowID is "Row7"

Client side
document.all["Row7"].style.display = "none";

Server side

myTable.FindControl( "Row7").Visible = false;

HTH,

bill

"MattB" <so********@yahoo.com> wrote in message
news:39*************@individual.net...
I'm trying to have a table that I can selectively hide or show it's rows
depending on some data in a database.
I see that I can refer to a row by index and toggle it's visible
property that way (mytable.rows(0).visible = false), but I may not
always know the order of rows so I'd love to be able to refer to a row
by id. It appears that can't be done the way I was trying, but is there
another alternative or workaround to do what I'd like?

I want to be able to have a row in an unknown position selectively shown
or hidden. Any hints or suggestions would be appreciated!

One thought I'll try now: Can I loop through the rows collection, check
id's, and then show/hide by current index?

Thanks!

Matt

Nov 19 '05 #2
Sorry I forgot to mention it was server side. Your suggestion was very
helpful. Thanks!

Matt

William F. Robertson, Jr. wrote:
Is this server side or client side?

Assume your rowID is "Row7"

Client side
document.all["Row7"].style.display = "none";

Server side

myTable.FindControl( "Row7").Visible = false;

HTH,

bill

"MattB" <so********@yahoo.com> wrote in message
news:39*************@individual.net...
I'm trying to have a table that I can selectively hide or show it's rows
depending on some data in a database.
I see that I can refer to a row by index and toggle it's visible
property that way (mytable.rows(0).visible = false), but I may not
always know the order of rows so I'd love to be able to refer to a row
by id. It appears that can't be done the way I was trying, but is there
another alternative or workaround to do what I'd like?

I want to be able to have a row in an unknown position selectively shown
or hidden. Any hints or suggestions would be appreciated!

One thought I'll try now: Can I loop through the rows collection, check
id's, and then show/hide by current index?

Thanks!

Matt


Nov 19 '05 #3

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

Similar topics

1
by: Rick Measham | last post by:
I have a set of data that I display in a table. Each row has a category and there may be a dozen or more rows in the same category. I'm looking to add filter buttons to the page to hide/show...
8
by: F. Da Costa | last post by:
Following is a snippet of html in which I hide a whole table and try to hide a single row. Here is my question (plz don't chew my head off if its css related instead): Why does the divTable...
5
by: mt | last post by:
In a nutshell, I'd like to have a list of items, each of which fills out a small table which displays some info about a particular item(the items being a trouble ticket for a tech support ASP-built...
1
by: luvdairish | last post by:
Can someone please look at my code and see why tables are not hiding properly? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD><TITLE>Untitled Document</TITLE> <META...
6
by: luvdairish | last post by:
I tried posting a few times, but it hasn't shown up. Hope this one works. Problem: Having trouble hiding tables when page is loaded. Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0...
5
by: Ben | last post by:
I have a form for data entry which is in a table. I have a select box to enter a customer name, which takes it's options from the customer database. I have a button to add a new customer. What I...
6
by: Roy | last post by:
Since a datagrid is just an html table anyways, this seems like it should be easy but it's giving me a hard time. In ItemDataBound sub I'm trying to kick off javascript code using response.write()....
1
by: Fix_Metal | last post by:
Hello all. I'm new to this group :) I have a problem with javascript language. I'm making an .asp page with some integrated Javascript functions. The page consists of some HTML selects and a...
2
by: Garg | last post by:
How do I hide a paricular tablerow during run time? I have two table rows with ids row1 and row2. I want that if a particualr condition is true, then row 1 should be displayed on the web page,...
2
by: chris f | last post by:
I have an ASP.NET 2 web page that dynamically populates an ASP table in the Page_Load event. Rows relate to different people and I want to let the user display only rows for a particular person...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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.