我创建了一个datatable
in 代码并将其设置为gridcontrol
( DevExpress component
) 以像此处的代码一样显示它(添加一行datatable
并将其设置为datasource
of gridcontrol
):
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
. 我该怎么做(行编辑,行删除)?