DataList Edit Mode

P

Peter

Hi

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

myDetailsView.ChangeMode(DetailsViewMode.Edit);

Thanks
Peter
 
G

Guest

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
 
P

Peter

Anon User 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top