DataList Edit Mode

Discussion in 'ASP .Net' started by Peter, Jul 3, 2009.

  1. Peter

    Peter Guest

    Hi

    May I know whether I can do the same with DataList as in DetailsView programmatically ?

    myDetailsView.ChangeMode(DetailsViewMode.Edit);

    Thanks
    Peter
    Peter, Jul 3, 2009
    #1
    1. Advertising

  2. On 3 Jul., 15:54, "Peter" <> wrote:
    > Hi
    >
    > May I know whether I can do the same with DataList as in DetailsView programmatically ?
    >
    > myDetailsView.ChangeMode(DetailsViewMode.Edit);
    >
    > Thanks
    > Peter


    To show Edit mode DataList uses EditItemTemplate and EditItemIndex. By
    default, the value of EditItemIndex is -1, meaning none of the items
    in the list is being edited. When EditItemIndex is set to a particular
    item, that item is displayed using the EditItemTemplate. Set
    EditItemIndex to any item, bind the DataList again and your list will
    be switched to Edit mode.

    Also you can just add an edit button with CommandName="edit" and
    specify OnEditCommand to switch DataList in to the Edit mode:
    http://msdn.microsoft.com/en-us/library/90xwe9s3.aspx

    Hope this helps
    Alexey Smirnov, Jul 4, 2009
    #2
    1. Advertising

  3. Peter

    Peter Guest

    "Alexey Smirnov" <> wrote in message
    news:...
    > On 3 Jul., 15:54, "Peter" <> wrote:
    >> Hi
    >>
    >> May I know whether I can do the same with DataList as in DetailsView programmatically ?
    >>
    >> myDetailsView.ChangeMode(DetailsViewMode.Edit);
    >>
    >> Thanks
    >> Peter

    >
    > To show Edit mode DataList uses EditItemTemplate and EditItemIndex. By
    > default, the value of EditItemIndex is -1, meaning none of the items
    > in the list is being edited. When EditItemIndex is set to a particular
    > item, that item is displayed using the EditItemTemplate. Set
    > EditItemIndex to any item, bind the DataList again and your list will
    > be switched to Edit mode.
    >
    > Also you can just add an edit button with CommandName="edit" and
    > specify OnEditCommand to switch DataList in to the Edit mode:
    > http://msdn.microsoft.com/en-us/library/90xwe9s3.aspx
    >
    > Hope this helps


    Thanks Alexey..will give it a try.

    Peter
    Peter, Jul 4, 2009
    #3
    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. Ravikanth[MVP]
    Replies:
    2
    Views:
    3,047
    buran
    Jul 22, 2003
  2. Saravana
    Replies:
    2
    Views:
    2,078
    Saravana
    Jul 25, 2003
  3. Frank Kurka
    Replies:
    8
    Views:
    305
  4. Jaime Stuardo

    GridView control enters edit mode when I click Edit link twice

    Jaime Stuardo, Apr 7, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    394
    Jaime Stuardo
    Apr 7, 2006
  5. jobs at webdos
    Replies:
    0
    Views:
    467
    jobs at webdos
    Oct 9, 2006
Loading...

Share This Page