private void dgvInser(List <WorkModel> workModels) { if (InvokeRequired) { this.Invoke(new Action <List <WorkModel> >(dgvInser), new object[] { workModels }); } else { foreach (WorkModel workModel in workModels) { _workManager.LoadDataToDgv(dgvDetial, workModel, 0); //dgvDetial.Rows.Insert(0, new object[] { false, // workModel.WorkCreateDate, // workModel.WorkNumber, // workModel.CustomName, // workModel.CustcName, // workModel.RightDegree, // workModel.LeftDegree, // workModel.FrameMode, // workModel.Degree, // workModel.GlassType, // workModel.AddDegree, // workModel.CreateMan, // workModel.Memo }); } } }
private void dgvInser(List <WorkModel> workModels) { if (InvokeRequired) { try { this.Invoke(new Action <List <WorkModel> >(dgvInser), new object[] { workModels }); } catch { } } else { try { int index = 0; foreach (var workModel in _currentWorkModel.OrderBy(x => x.WorkCreateDate).ToList()) { _workManager.LoadDataToDgv(dgvDetial, workModel, index); index++; // dgvDetial.Rows.Insert(0, new object[] { workModel.WorkCreateDate, workModel.WorkNumber, workModel.CustomName, workModel.RightDegree, workModel.LeftDegree, workModel.Memo }); } } catch //(Exception) { // throw; } } }
private void dgvInser(List <WorkModel> workModels) { if (InvokeRequired) { this.Invoke(new Action <List <WorkModel> >(dgvInser), new object[] { workModels }); } else { dgvWorkHead.Rows.Clear(); if (workModels.Count > 0) { int rowIndex = 0; foreach (WorkModel workModel in workModels) { _workManager.LoadDataToDgv(dgvWorkHead, workModel, rowIndex); //dgvWorkHead.Rows.Add(new object[] { false, // // workModel.WorkCreateDate, // workModel.WorkNumber, // workModel.CustomName, // workModel.RightDegree, // workModel.LeftDegree, // workModel.FrameMode, // workModel.Degree, // workModel.GlassType, // workModel.AddDegree, // workModel.CreateMan, // workModel.Memo }); //int startcol = dgvWorkHead.Columns.Count - workModel.Step.Count; //for (int stepNo = 0; stepNo < workModel.Step.Count; stepNo++) //{ // if (workModel.Step[stepNo + 1] != DateTime.MinValue) // dgvWorkHead[startcol, rowIndex].Value = workModel.Step[stepNo + 1]; // startcol++; //} rowIndex++; } } } }
private void dgvInser(List <WorkModel> workModels) { if (InvokeRequired) { this.Invoke(new Action <List <WorkModel> >(dgvInser), new object[] { workModels }); } else { dgvDetial.Rows.Clear(); for (int rowIndex = 0; rowIndex < _workModel.Count; rowIndex++) { _workManager.LoadDataToDgv(dgvDetial, _workModel[rowIndex], rowIndex); } } }