hiding table rows by id?

  • Thread starter Thread starter MattB
  • Start date Start date
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
 
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
 
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
 
Back
Top