How to set the datagrid in edit mode

D

David Sagenaut

Can I set a whole datagrid in edit mode, like a table? I can edit the data
in the datagrid. After done, I can click the save button to save the data
into a datasousce. I don't want to used the build-in edit function in the
datagrid in which you only can edit one line at a time. I want to edit
whole datagrid and save it just once. Thanks in advance.

David
 
G

Guest

If your DataGrid EditTemplates display only textboxes, you would get the
outcome you desire by replacing the BoundColumns with TemplateColumns that
define only the ItemTemplate with textboxes; in which case you get only the
edit mode.

<asp:TemplateColumn>
<ItemTemplate>
<asp:TextBox runat=server Text='<%# DataBinder.Eval(Container.DataItem,
"FieldName")%>'></asp:TextBox>
</ItemTemplate>
</asp:TemplateColumn>
 

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,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top