Is there any way to affect gridview row appearance based on contents?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • COHENMARVIN@lycos.com

    Is there any way to affect gridview row appearance based on contents?

    I have a gridview with a button that should only appear if the
    database routine it is based on returns a value of 'True' for the
    database field "ReservationsEx ist". So I tried putting in the
    following:

    <asp:ButtonFiel d ButtonType="But ton"
    CommandName="Re servations"
    HeaderText="Vie w Reserves"
    Text="View Reserves" Visible='<%#
    Eval("Reservati onsExist") %>' />

    This does not work. I get an error message saying that ButtonFields
    don't have a 'DataBinding' event, and therefore I can't do this.
    Is there some way of doing this? In general it would enhance a
    gridview if you could do things like this.
    -- Thanks,
    Marv.
  • Jonathan Wood

    #2
    Re: Is there any way to affect gridview row appearance based on contents?

    You can override the GridView's DataBound event and modify things there.

    --
    Jonathan Wood
    SoftCircuits Programming


    <COHENMARVIN@ly cos.comwrote in message
    news:614f0dcf-f25c-4368-b455-6214d0315842@s5 0g2000hsb.googl egroups.com...
    >I have a gridview with a button that should only appear if the
    database routine it is based on returns a value of 'True' for the
    database field "ReservationsEx ist". So I tried putting in the
    following:
    >
    <asp:ButtonFiel d ButtonType="But ton"
    CommandName="Re servations"
    HeaderText="Vie w Reserves"
    Text="View Reserves" Visible='<%#
    Eval("Reservati onsExist") %>' />
    >
    This does not work. I get an error message saying that ButtonFields
    don't have a 'DataBinding' event, and therefore I can't do this.
    Is there some way of doing this? In general it would enhance a
    gridview if you could do things like this.
    -- Thanks,
    Marv.

    Comment

    Working...