详细信息视图字段在编辑模式下未更改为文本框

发布于 2024-11-06 04:30:46 字数 583 浏览 4 评论 0原文

我以编程方式创建了一个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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

神经大条 2024-11-13 04:30:46

看看这是否有帮助:
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/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文