Hide Table Row In Repeater?

Discussion in 'ASP .Net' started by Utter Newbie, Aug 25, 2005.

  1. Utter Newbie

    Utter Newbie Guest

    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.
     
    Utter Newbie, Aug 25, 2005
    #1
    1. Advertising

  2. Utter Newbie

    Guest

    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

    }
     
    , Aug 25, 2005
    #2
    1. Advertising

  3. Utter Newbie

    Utter Newbie Guest

    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.

    On Thu, 25 Aug 2005 11:59:37 -0600, Utter Newbie <>
    wrote:

    >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.
     
    Utter Newbie, Aug 25, 2005
    #3
  4. Utter Newbie

    Guest

    sorry abt the wrong comment

    return("style='display:'"); // this will DISPLAY the row
     
    , Aug 25, 2005
    #4
  5. Utter Newbie

    Utter Newbie Guest

    Thanks. Never thought ot fhat one.

    On 25 Aug 2005 11:55:43 -0700, wrote:

    >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
    >
    >}
     
    Utter Newbie, Aug 26, 2005
    #5
  6. Utter Newbie

    bartekm

    Joined:
    Aug 17, 2008
    Messages:
    7
    bartekm, Mar 3, 2011
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. RA
    Replies:
    1
    Views:
    4,052
  2. =?Utf-8?B?UmljaGFyZEg=?=

    Checkbox and dropdownlist row in repeater row

    =?Utf-8?B?UmljaGFyZEg=?=, Mar 23, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    6,425
    =?Utf-8?B?UmljaGFyZEg=?=
    Mar 24, 2006
  3. phl
    Replies:
    1
    Views:
    4,430
    Martin Jay
    Jun 8, 2006
  4. D
    Replies:
    0
    Views:
    255
  5. UJ
    Replies:
    1
    Views:
    142
Loading...

Share This Page