DataGridTextBoxColumn.Commit(CurrencyManager, Int32) 方法

定义

初始化一个请求以完成一个编辑过程。Initiates a request to complete an editing procedure.

protected public:
 override bool Commit(System::Windows::Forms::CurrencyManager ^ dataSource, int rowNum);
protected internal override bool Commit (System.Windows.Forms.CurrencyManager dataSource, int rowNum);
override this.Commit : System.Windows.Forms.CurrencyManager * int -> bool
Protected Friend Overrides Function Commit (dataSource As CurrencyManager, rowNum As Integer) As Boolean

参数

dataSource
CurrencyManager

该列所属的 CurrencyManager 控件的 DataGridThe CurrencyManager of the DataGrid control the column belongs to.

rowNum
Int32

所编辑行的行号。The number of the edited row.

返回

Boolean

如果该值已成功提交,则为 true;否则为 falsetrue if the value was successfully committed; otherwise, false.

注解

方法会进行检查以确保确实发生了编辑。The method checks to ensure that an edit is indeed occurring. 如果是这样,则会相应地设置值的格式。If so, it formats the value appropriately. 如果值为 null ,则该方法将输入 DBNull 到列中; 否则,它将使用 SetColumnValueAtRow 方法来提交值。If the value is null, the method enters DBNull into the column; otherwise, it uses the SetColumnValueAtRow method to commit the value.

DataGrid 提交编辑操作时,将调用方法。The method is called by the DataGrid when an editing operation is committed.

适用于

另请参阅