I create a datatable
in code and set it to a gridcontrol
(DevExpress component
) to show it like the code here (add one row to datatable
and set it as 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;
The user can change data in my gridcontrol
. I want to have changes in my gridcontrol
updated to my datatable
. How can I do that (row edited, row deleted)?