private void FillDataGrid(dynamic list) { foreach (var item in list) { var r = new CustomControls.DataRow(); DVValues.Add(r.CreateRow(item), item._id); } }
/// <summary> /// Refreshes the DataGridView based on given last type choosen, from database /// </summary> private void RefreshDataGridView() { dynamic comps = GetCRUD(_lastType); var list = comps.GetAll(); DVValues.Init(_lastType); FillDataGrid(list); }
/// <summary> /// Refreshes the DataGridView based on given Type, from database. /// </summary> /// <typeparam name="T"></typeparam> private void RefreshDataGridView <T>() where T : DbObject, new() { dynamic comps = new CRUD <T>(); var list = comps.GetAll(); DVValues.Init <T>(); FillDataGrid(list); }