GRIDVIEW: condition processing

Discussion in 'ASP .Net' started by =?Utf-8?B?TWFya0F1cml0?=, Feb 7, 2007.

  1. am displaying data in a gridview. I have an "edit" link in a
    asp:ButtonField; when the link is clicked an edit page comes up with the key
    (from a datafield). Its all good.

    However, I need to do some conditional processing, and don’t know how. In
    one of the columns, either numbers of blanks are displayed. If blanks, I
    want to disable
    or not show the edit link, rather than have it go to the edit page. Is that
    possible?
    =?Utf-8?B?TWFya0F1cml0?=, Feb 7, 2007
    #1
    1. Advertising

  2. Handle RowDataBound event. The event fires for every row after it gets
    populated with the data from the datasource. You have access to both row
    cells and the datasource fields. You can check the required conditions and
    set the content of any cells accordingly.

    --
    Eliyahu Goldin,
    Software Developer & Consultant
    Microsoft MVP [ASP.NET]
    http://msmvps.com/blogs/egoldin


    "MarkAurit" <> wrote in message
    news:...
    > am displaying data in a gridview. I have an "edit" link in a
    > asp:ButtonField; when the link is clicked an edit page comes up with the

    key
    > (from a datafield). Its all good.
    >
    > However, I need to do some conditional processing, and don't know how. In
    > one of the columns, either numbers of blanks are displayed. If blanks, I
    > want to disable
    > or not show the edit link, rather than have it go to the edit page. Is

    that
    > possible?
    Eliyahu Goldin, Feb 7, 2007
    #2
    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. -
    Replies:
    12
    Views:
    668
    Remon van Vliet
    Jun 15, 2005
  2. Mike P
    Replies:
    3
    Views:
    4,177
    PeterKellner
    Jun 6, 2006
  3. Jim in Arizona

    Condition Formatting on GridView

    Jim in Arizona, Aug 16, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    4,773
    Jim in Arizona
    Aug 17, 2006
  4. philbo30
    Replies:
    12
    Views:
    444
    Keith Thompson
    Jun 7, 2007
  5. Bill W.
    Replies:
    13
    Views:
    275
    Phillip Gawlowski
    May 9, 2011
Loading...

Share This Page