hiding table rows by id?

M

MattB

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
 
W

William F. Robertson, Jr.

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
 
M

MattB

Sorry I forgot to mention it was server side. Your suggestion was very
helpful. Thanks!

Matt
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

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
 

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,994
Messages
2,570,222
Members
46,810
Latest member
Kassie0918

Latest Threads

Top