详细信息视图字段在编辑模式下未更改为文本框
我以编程方式创建了一个DetailsView,并添加了一个按钮来触发添加、编辑和删除命令。
以下是命令的事件处理程序:
switch (e.CommandName)
{
case "Add":
dvSpotlightListDetails.ChangeMode(DetailsViewMode.Insert);
break;
case "Edit":
dvSpotlightListDetails.ChangeMode(DetailsViewMode.Edit);
break;
default:
break;
}
添加/插入命令将 DetailsView 上的字段更改为文本框。但是当选择编辑命令时什么也没有发生。
我不太熟悉通过代码隐藏创建的 DetailsView 的过程,所以我不确定我错过了什么。
I created a DetailsView programmatically and I added a button to fire commands for the add, edit and delete.
Here's the event handler for the commands:
switch (e.CommandName)
{
case "Add":
dvSpotlightListDetails.ChangeMode(DetailsViewMode.Insert);
break;
case "Edit":
dvSpotlightListDetails.ChangeMode(DetailsViewMode.Edit);
break;
default:
break;
}
The add/insert commands changes the fields on the DetailsView to textboxes. But when selecting the edit command nothing happens.
I'm not so familiar with the process of the DetailsView when made through code-behind so I'm not sure what I am missing.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看看这是否有帮助:
http://forums.asp.net/t/1249276.aspx/1
http://www.shotdev.com/aspnet/aspnet-vbnet-detailsview/aspnet-vbnet-detailsview-edit-update/
See if this helps:
http://forums.asp.net/t/1249276.aspx/1
http://www.shotdev.com/aspnet/aspnet-vbnet-detailsview/aspnet-vbnet-detailsview-edit-update/