public void configDatagrid() { for (int i = 0; i < Rwlist.Length; i++) { GridVrid node = new GridVrid(); //node.Xh = (i+1).ToString(); node.Th = Rwlist[i].TH; node.Pfdh = Rwlist[i].PFDH; node.Pldh = Rwlist[i].PLDH; node.Xfcd = Rwlist[i].XFCDNAME; node.Xfpc = Rwlist[i].XFPC; Finish.Add(Rwlist[i].ISACTION); JhList.Add(node); } jldataGridView.DataSource = JhList; jldataGridView.Columns["完成状态"].DefaultCellStyle.BackColor = Color.Red; for (int i = 0; i < Finish.Count; i++) { if (Finish[i] >= 1) { jldataGridView.Rows[i].Cells["完成状态"].Style.BackColor = Color.FromArgb(187, 255, 102); } } }
public void configDatagrid() { for (int i = 0; i < Rwlist.Length; i++) { GridVrid node = new GridVrid(); //node.Xh = (i+1).ToString(); node.Th = Rwlist[i].TH; node.Pfdh = Rwlist[i].PFDH; //node.Pldh = Rwlist[i].PLDH; node.Xfpc = Rwlist[i].XFPC; node.Xfcd = Rwlist[i].XFCDNAME; if (string.IsNullOrEmpty(Rwlist[i].TLSJ)) { node.Tlsj = Rwlist[i].TLSJ; } else { node.Tlsj = Convert.ToDateTime(Rwlist[i].TLSJ).ToString("HH:mm"); } //node.Gyspc = Rwlist[i].GYSPC; Finish.Add(Rwlist[i].ISACTION); JhList.Add(node); } jldataGridView.DataSource = JhList; jldataGridView.Columns[q(Msg_Type.fieldwczt)].DefaultCellStyle.BackColor = Color.Red;//"完成状态" for (int i = 0; i < Finish.Count; i++) { if (Finish[i] >= 1) { jldataGridView.Rows[i].Cells[q(Msg_Type.fieldwczt)].Style.BackColor = Color.FromArgb(187, 255, 102);//"完成状态" } } }
public void configDatagrid(MES_PD_SCRW_LIST[] model) { for (int i = 0; i < model.Length; i++) { GridVrid node = new GridVrid(); //node.Xh = (i + 1).ToString(); node.Th = model[i].TH; node.Pfdh = model[i].PFDH; node.Pldh = model[i].PLDH; node.Xfcd = model[i].XFCDNAME; node.Xfpc = model[i].XFPC; Unfinish.Add(model[i].ISACTION); JhList.Add(node); } ListdataGridView.DataSource = JhList; }
public void ShowList(radioType type) { JhList = new List <GridVrid>(); Finish = new List <int>(); for (int i = 0; i < Rwlist.Length; i++) { switch (type) { case radioType.all: { GridVrid node = new GridVrid(); node.Th = Rwlist[i].TH; node.Pfdh = Rwlist[i].PFDH; node.Xfpc = Rwlist[i].XFPC; node.Xfcd = Rwlist[i].XFCDNAME; if (string.IsNullOrEmpty(Rwlist[i].TLSJ)) { node.Tlsj = Rwlist[i].TLSJ; } else { node.Tlsj = Convert.ToDateTime(Rwlist[i].TLSJ).ToString("HH:mm"); } //node.Gyspc = Rwlist[i].GYSPC; Finish.Add(Rwlist[i].ISACTION); JhList.Add(node); } break; case radioType.finish: { if (Rwlist[i].ISACTION >= 1) { GridVrid node = new GridVrid(); node.Th = Rwlist[i].TH; node.Pfdh = Rwlist[i].PFDH; node.Xfpc = Rwlist[i].XFPC; node.Xfcd = Rwlist[i].XFCDNAME; //node.Gyspc = Rwlist[i].GYSPC; if (string.IsNullOrEmpty(Rwlist[i].TLSJ)) { node.Tlsj = Rwlist[i].TLSJ; } else { node.Tlsj = Convert.ToDateTime(Rwlist[i].TLSJ).ToString("HH:mm"); } Finish.Add(Rwlist[i].ISACTION); JhList.Add(node); } } break; case radioType.unfinish: { if (Rwlist[i].ISACTION == 0) { GridVrid node = new GridVrid(); node.Th = Rwlist[i].TH; node.Pfdh = Rwlist[i].PFDH; node.Xfpc = Rwlist[i].XFPC; node.Xfcd = Rwlist[i].XFCDNAME; //node.Gyspc = Rwlist[i].GYSPC; if (string.IsNullOrEmpty(Rwlist[i].TLSJ)) { node.Tlsj = Rwlist[i].TLSJ; } else { node.Tlsj = Convert.ToDateTime(Rwlist[i].TLSJ).ToString("HH:mm"); } Finish.Add(Rwlist[i].ISACTION); JhList.Add(node); } } break; default: break; } } jldataGridView.DataSource = JhList; jldataGridView.Columns[q(Msg_Type.fieldwczt)].DefaultCellStyle.BackColor = Color.Red;//"完成状态" for (int i = 0; i < Finish.Count; i++) { if (Finish[i] >= 1) { jldataGridView.Rows[i].Cells[q(Msg_Type.fieldwczt)].Style.BackColor = Color.FromArgb(187, 255, 102);//"完成状态" } } jldataGridView.Columns[q(Msg_Type.fieldwczt)].DisplayIndex = 5; //"完成状态" jldataGridView.Columns[q(Msg_Type.fieldxfcd)].DisplayIndex = 2; //"锌粉产地" if (type == radioType.all) { int index = Rwlist.ToList().FindIndex(p => p.ISACTION == 0); if (index != -1) { jldataGridView.CurrentCell = jldataGridView.Rows[Index].Cells[0]; } } jldataGridView.ClearSelection(); SMtextBox.Select(); }