private Infragistics.WebUI.UltraWebGrid.ValueList EmployeeRoles() { Infragistics.WebUI.UltraWebGrid.ValueList vList = new Infragistics.WebUI.UltraWebGrid.ValueList(); // Add Items vList.ValueListItems.Add("Engineer", "Engineer"); vList.ValueListItems.Add("Project Manager", "Project Manager"); // return vList; }
private Infragistics.WebUI.UltraWebGrid.ValueList EmployeeTypes() { Infragistics.WebUI.UltraWebGrid.ValueList vList = new Infragistics.WebUI.UltraWebGrid.ValueList(); // Add Blank Row vList.ValueListItems.Add(0, ""); // Get rest of items string strSQL = null; strSQL = "SELECT ID, EmployeeType "; strSQL += "FROM tblEmployeeTypes "; strSQL += "WHERE EmployeeType <> 'Admin'"; SqlConnection conn = new SqlConnection(strConn); SqlCommand cmd = new SqlCommand(strSQL, conn); conn.Open(); SqlDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); while (dr.Read()) { vList.ValueListItems.Add(dr.GetValueOrDefault<int>("ID"), dr.GetValueOrDefault<string>("EmployeeType")); } dr.Close(); conn = null; cmd = null; dr = null; // return vList; }