Hide DataList Items

Discussion in 'ASP .Net' started by Chris Kettenbach, Oct 27, 2005.

  1. Good Afternoon all,
    I have a datalist. When I switch in to edit mode, I need to hide a couple
    controls on the "ItemTemplate" and of course, when exiting Edit Mode, I will
    need to show these items again. Any ideas? I have tried referencing the
    controls and setting their visibile property to false, I tried in the
    datalist item created and item databound events, but it can not find the
    controls.Object reference not set to an instance of an object

    Thanks for any suggestions,
    Chris
    Chris Kettenbach, Oct 27, 2005
    #1
    1. Advertising

  2. I found a nice fix to this. I bound the visible property of the controls to
    a function that evaluates if the datalist is in edit mode, if it is I return
    false and hide the items. it works great!


    "Chris Kettenbach" <> wrote in message
    news:...
    > Good Afternoon all,
    > I have a datalist. When I switch in to edit mode, I need to hide a couple
    > controls on the "ItemTemplate" and of course, when exiting Edit Mode, I
    > will need to show these items again. Any ideas? I have tried referencing
    > the controls and setting their visibile property to false, I tried in the
    > datalist item created and item databound events, but it can not find the
    > controls.Object reference not set to an instance of an object
    >
    > Thanks for any suggestions,
    > Chris
    >
    Chris Kettenbach, Oct 28, 2005
    #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. Nevyn Twyll
    Replies:
    8
    Views:
    1,848
  2. Michel Couche

    Datalist: "hide/show" more details

    Michel Couche, Feb 1, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    495
    Michel Couche
    Feb 1, 2006
  3. steven
    Replies:
    2
    Views:
    554
    steven
    Jan 10, 2005
  4. RS
    Replies:
    0
    Views:
    424
  5. beaudetious

    Hide Menu Items Based On Roles

    beaudetious, Jan 8, 2006, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    193
    sloan
    Jan 9, 2006
Loading...

Share This Page