0
我創建一個datatable
的代碼並將其設置爲gridcontrol
(DevExpress component
)以顯示它像這裏的代碼(添加一行到datatable
並將其設置爲的gridcontrol
datasource
):如何更改gridview更新爲datatable,我創建代碼
DataTable PersonFamiliesDataTable = new DataTable();
PersonFamiliesDataTable.Columns.Add("BirthDate", typeof(String));
PersonFamiliesDataTable.Columns.Add("Job", typeof(String));
PersonFamiliesDataTable.Columns.Add("NameFamily", typeof(String));
DataRow PersonFamilyRow = PersonFamiliesDataTable.NewRow();
PersonFamilyRow["BirthDate"] = DateTimePicker_FamilyInfo_BirthDate.Text;
PersonFamilyRow["Job"] = FamilyInfo_txt_job.Text;
PersonFamilyRow["NameFamily"] = FamilyInfo_txt_NameFamily.Text;
PersonFamiliesDataTable.Rows.Add(PersonFamilyRow);
grid_Family.DataSource = PersonFamiliesDataTable;
用戶可以在我的gridcontrol
更改數據。我想將我的gridcontrol
中的更改更新爲我的datatable
。我該怎麼做(行編輯,行刪除)?