简体   繁体   English

DetailsView预览模式?

[英]DetailsView Preview mode?

DetailsView1.DefaultMode = DetailsViewMode.Insert; DetailsView1.DefaultMode = DetailsViewMode.Insert;

After inserting how can i Preview Data before Submitting/Inserting data in the table? 插入后,如何在提交/插入表中的数据之前预览数据?

I know the code would be: DetailsView1.DefaultMode = DetailsViewMode.ReadOnly; 我知道代码是:DetailsView1.DefaultMode = DetailsViewMode.ReadOnly;

Where do I put this code BEFORE submitting/inserting data in the table? 在提交/插入表中的数据之前,我应该将该代码放在哪里?

Not totally clear on what you're asking. 不清楚您要问什么。

If you are looking to inspect or modify data before it is inserted into the table you could look at the DetailsView.ItemInserting Event 如果要在将数据插入表之前检查或修改数据,可以查看DetailsView.ItemInserting事件

The ItemInserting event is raised when an Insert button within a DetailsView control is clicked, but before the insert operation. 单击DetailsView控件中的“插入”按钮时,但在插入操作之前,将引发ItemInserting事件。 This allows you to provide an event handler that performs a custom routine, such as canceling the insert operation, whenever this event occurs. 这样,您可以提供一个事件处理程序,该事件处理程序在发生此事件时执行自定义例程,例如取消插入操作。

You can find further information at this MSDN link 您可以在此MSDN链接中找到更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM