設定 bindingNavigator 新增一筆紀錄時,帶入預設值

VS 2005 WindowsForm 自動加入 DataTable 的 UI 時,預設透過 BindingNavigator 新增一筆紀錄,替 BindingSource 當下紀錄某個欄位塞入 Guid 當預設值
        private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e)
        {
            ((DataRowView)buildingBasicBindingSource.Current)["ID"] = System.Guid.NewGuid().ToString();
        }

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 變更 )

Twitter picture

You are commenting using your Twitter account. Log Out / 變更 )

Facebook照片

You are commenting using your Facebook account. Log Out / 變更 )

Google+ photo

You are commenting using your Google+ account. Log Out / 變更 )

連結到 %s

%d 位部落客按了讚: