Reputation: 1448
I am using a DetailsView in ASP.net. And I would like that you can edit one field at a time. Is this possible?
Here is my DetailsView
<asp:DetailsView ID="dvProfiel" runat="server"
DataSourceID="odsUserByUserName" AutoGenerateRows="False">
<Fields>
<asp:TemplateField HeaderText="ID">
<ItemTemplate>
<asp:Label ID="lblKlantenNummer" runat="server" Text='<%# Eval("ID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="First Name">
<ItemTemplate>
<asp:Label ID="lblFirstName" runat="server" Text='<%# Eval("FirstName") %>'></asp:Label>
<asp:LinkButton ID="lbEditFirstName" CommandName="Edit" runat="server">Edit</asp:LinkButton>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtFirstName" Text='<%# Bind("FirstName") %>' runat="server"></asp:TextBox>
<asp:LinkButton ID="lbUpdateFirstName" CommandName="Update" runat="server">Update</asp:LinkButton>
<asp:LinkButton ID="lbCancelFirstName" CommandName="Cancel" runat="server">Cancel</asp:LinkButton>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Last Name">
<ItemTemplate>
<asp:Label ID="lblLastName" runat="server" Text='<%# Eval("LastName") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtLastName" Text='<%# Bind("LastName") %>' runat="server"></asp:TextBox>
<asp:LinkButton ID="lbUpdateLastName" CommandName="Update" runat="server">Update</asp:LinkButton>
<asp:LinkButton ID="lbCancelLastName" CommandName="Cancel" runat="server">Cancel</asp:LinkButton>
</EditItemTemplate>
</asp:TemplateField>
</Fields>
</asp:DetailsView>
When I click to edit the First Name, the field Last Name als goes into Edit mode. I just want the field where I clicked the edit button that goes in Edit mode.
I hope you understand me.
Thank you, Vincent
Upvotes: 1
Views: 1810
Reputation: 14216
Here is the link that might help you.
http://www.daniweb.com/forums/thread207014.html
Upvotes: 1