DataList Edit Mode

  • Thread starter Thread starter Peter
  • Start date Start date
P

Peter

Hi

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

myDetailsView.ChangeMode(DetailsViewMode.Edit);

Thanks
Peter
 
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 said:
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
 
Back
Top