如何使用devexpress将数据从gridcontrol编辑和保存到数据库

时间:2020-09-03 07:37:56

标签: c# devexpress devexpress-windows-ui

这是我显示的数据-之所以有它,是因为我将其输入了数据库:

Displayed data

ServiceRecordEmployeeRecord来自]

2result from postman 这是我的保存方法,我的代码不正确,我不知道正确的代码是什么:

int rowendix;
rowendix = GV_ServiceRec.GetDataSourceRowIndex(GV_ServiceRec.FocusedRowHandle);

Type_ServiceRecord MyServiceRec = new Type_ServiceRecord
{
     EmployeeID = Txt_EmployeeID.Text,
     RecordID = Txt_RecordNumber.Text,
     JobTitle = GV_ServiceRec.GetRowCellDisplayText(rowendix,"JobTitle"),
     ServiceFrom = GV_ServiceRec.GetRowCellDisplayText(rowendix, "ServiceFrom"),
     ServiceTo = GV_ServiceRec.GetRowCellDisplayText(rowendix, "ServiceTo"),
     Salary = GV_ServiceRec.GetRowCellDisplayText(rowendix, "Salary"),
     EmploymentStatus = GV_ServiceRec.GetRowCellDisplayText(rowendix, "EmploymentStatus")
};

0 个答案:

没有答案