Results 1 to 4 of 4

Thread: DataBinding...Make something visible is property = false.

  1. #1

    Thread Starter
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    DataBinding...Make something visible is property = false.

    I have:
    Code:
    Visible='<%# DataBinder.Eval(Container.DataItem, "wipeInitiated") %>'
    on some of my controls in a datagrid.

    However, I want it to be visible on NOT wipeInitaited...how do i do this?

    Woof

  2. #2
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092

    Re: DataBinding...Make something visible is property = false.

    Could you write a function that accepted "wipeInitiated" as a parameter and returned the opposite of it?

    Code:
    		private bool Reverse(bool dbValue)
    		{
    			return(!dbValue);
    		}
    and then have
    Code:
    Visible='<%# DataBinder.Eval(Container.DataItem, Reverse("wipeInitiated")) %>
    I'll be honest and admit i'm guessing.

  3. #3
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092

    Re: DataBinding...Make something visible is property = false.

    mmmm I guess the Function should be on the outside of the databind.
    Code:
    Visible='<%# Reverse(DataBinder.Eval(Container.DataItem, "wipeInitiated")) %>

  4. #4
    C# Aficionado Lord_Rat's Avatar
    Join Date
    Sep 2001
    Location
    Cave
    Posts
    2,497

    Re: DataBinding...Make something visible is property = false.

    I usually select the opposite directly from the database.

    I know that doesn't exactly answer your question, but I thought I would throw it out there.
    Need to re-register ASP.NET?
    C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i

    (Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width