c#编辑Datagridview中的SQL

c#编辑Datagridview中的SQL

本文介绍了c#编辑Datagridview中的SQL Server Management Studio中的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果你点击表格的上下文菜单中的编辑前200行,我希望我的c#program with datagridview几乎像SQL Server Management Studio一样工作。

没有保存-Button并且如果数据是假的,你不能将焦点放在另一行上。



在数据网格视图中从一行留下焦点之前,在C#中进行验证,可以取消焦点松散。像Before_Row_Update之类的东西。 CellValidating不起作用,因为它阻止用户输入不同列中的数据。



示例:两列,都必须填充数据。用户在Col 1中输入值,然后在其他行上点击。现在必须进行验证(错误,因为Col 2为空)并且焦点应保留在Col1中,但用户必须能够将焦点设置在Col 2.如果焦点自动设置为Col 2,则会更好。 br />


我以为我可以使用RowLeaveEvent,但这个事件似乎不可取消。



期待: - )

I want my c# program with datagridview to work almost exaktly like SQL Server Management Studio if you click on "Edit top 200 Rows" in the context menu of a table.
There is no "Save-Button" and you can't put the focus on a other row, if data are false.

Before the focus is left from a row in a datagridview, a verification in C# shall be done, in which the focus loose can be canceled. Something like Before_Row_Update. CellValidating is not working, because it prevents the user from entering data in a different column.

Example: two columns, both have to be filled with data. User enters value in Col 1 and then klicks on other row. Now verification has to be done (error because Col 2 is empty) and the focus shall stay in Col1 but the user must be able to set the focus on Col 2. It would be better if the focus is set automatically to Col 2.

I thought i could use the RowLeaveEvent, but this Event seems not to be cancellable.

Looking forward :-)

推荐答案



这篇关于c#编辑Datagridview中的SQL Server Management Studio中的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 11:45