private void add_data() { DataTable dt = new DataTable(); ListItem_nv.Clear(); dt = CMD_hengio.Show_hengio(); foreach (DataRow Row in dt.Rows) { Item_hengio item= new Item_hengio(); item.name_nv = Row[1].ToString(); item.ip_thuchien= Row[2].ToString(); item.time = ((DateTime)Row[3]).ToString("HH:mm:ss");// Row[3].ToString("HH:mm:ss"); item.date_start = ((DateTime)Row[4]).ToString("dd/MM/yyyy"); item.date_end =((DateTime)Row[6]).ToString("dd/MM/yyyy"); item.repeat = Row[5].ToString(); item.notes = Row[9].ToString(); item.status = Row[8].ToString(); item.tag_item = Row[0].ToString() + "*" + Row[7].ToString(); // add tag. if (item.status == "Unfulfilled") item.Name_color = "Yellow"; if (item.status == "Processing") item.Name_color = "Green"; if (item.status == "Stop") item.Name_color = "Red"; if (item.status == "Pause") item.Name_color = "YellowGreen"; if (item.notes == "Error date") { item.Color_Notes = "Red"; } if (item.notes == "Error timer") { item.Color_Notes = "Red"; } else item.Color_Notes = "#FF477067"; ListItem_nv.Add(item); } Datagrid.ItemsSource = ListItem_nv; ICollectionView view = CollectionViewSource.GetDefaultView(ListItem_nv); view.Refresh(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)