共用方式為


Windows Form DataGridView 控制項中的資料輸入

DataGridView 控件提供數個功能,可讓您變更使用者在控件中新增或修改資料的方式。 例如,您可以提供新資料列的預設值,並在發生錯誤時警示使用者,讓資料項目更有效率。

本節中

操作說明:指定 Windows Forms DataGridView 控制項的編輯模式
描述如何變更使用者開始編輯資料格的方式。

操作說明:指定 Windows Forms DataGridView 控制項新資料列的預設值
描述如何預先填入新記錄的資料列,以儲存資料輸入時間。

使用 Windows Forms DataGridView 控制項中用於新增記錄的資料列
詳細描述新記錄的資料列,包括隱藏、自定義其外觀的相關資訊,以及其與 Rows 集合的關聯性。

逐步解說:驗證 Windows Forms DataGridView 控制項中的資料
描述如何驗證使用者輸入以防止資料項目格式錯誤。

逐步解說:處理 Windows Forms DataGridView 控制項中的資料輸入期間所發生的錯誤
描述當使用者嘗試認可新值時,如何處理源自元的資料項目錯誤。

參考文獻

DataGridView 提供控制件的 DataGridView 參考檔。

DataGridView.EditMode 提供屬性的 EditMode 參考檔。

DataGridView.DefaultValuesNeeded 提供 DefaultValuesNeeded 事件的參考文件。

DataGridView.DataError 提供 DataError 事件的參考文件。

DataGridView.CellValidating 提供 CellValidating 事件的參考文件。

在 Windows Forms DataGridView 控制項中顯示資料
提供主題描述如何以手動方式或從外部資料來源將資料填入控制項。

另請參閱