Hide Table Row In Repeater?

U

Utter Newbie

Anyone know how to hide a table row in a repeater based on data
returned from a data row? I tried doing this:

<tr id="melon" runat="server" visible='<%# SetBoxVisibility(
DataBinder.Eval(Container,"DataItem.TheItem").ToString() ) %>'>

doesn't seem to work. The runat="server" in the row seems to throw an
error when within a repeater. So I'm looking for another solution?
Thanks for any suggestions.
 
S

sreejith.ram

the row doesnt need to be runat="server" to set visibility using a
function.

<tr id="melon" style="<%# SetBoxVisibility(
DataBinder.Eval(Container,"Dat­aItem.TheItem").ToString() ) %>">

string SetBoxVisibility( string inStr)
{
if(inStr == ......)
return("style='display:none'"); // this will hide the
row
else
return("style='display:'"); // this will hide the row

}
 
U

Utter Newbie

Think I might have solved it by just placing a placeholder tags to
encompass the row.. Then set visibility on the placeholder in a
similar way.
 
S

sreejith.ram

sorry abt the wrong comment

return("style='display:'"); // this will DISPLAY the row
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top