private void GetList() { try { ListHelper.FillMetroCombo(mcboUserGroupCode, usergroupbal.GetAll().Select(i => new { i.UserGroupCode, i.UserGroupDesc }).Distinct().OrderBy(m => m.UserGroupDesc).ToList(), "UserGroupCode", "UserGroupDesc"); //section ListHelper.FillMetroCombo(mcboSectionCode, sectionbal.GetAll().Select(i => new { i.SECTIONCODE, i.SECTIONDESC }).Distinct().OrderBy(m => m.SECTIONDESC).ToList(), "SECTIONCODE", "SECTIONDESC"); } catch (Exception ex) { throw ex; } }
public void RefreshGrid() { try { var list = Sectionbal.GetAll().Distinct().OrderBy(m => m.SECTIONDESC).ToList(); DataTable sectTable = new DataTable(); using (var reader = ObjectReader.Create(list, "RecID", "SECTIONCODE", "SECTIONDESC", "IsActive")) { sectTable.Load(reader); mgridList.DataSource = sectTable; } dgvorig.DataSource = mgridList.DataSource; Grid.ListCheck(mgridList, listTS); tslblRowCount.Text = "Number of Records: " + list.Count + " "; } catch (Exception ex) { MessageHelpers.ShowError(ex.Message); } }