void gridJQFactorItems_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e) { try { GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; JQManager jqm = new JQManager(); switch (e.DetailTableView.Name) { case "RatingScale": { long ratingScaleID = (long)dataItem.GetDataKeyValue("RatingScaleID"); // pull rating scale from cached version JQRatingScaleCollection cachedScaleList = LookupWrapper.GetJQRatingScale(false); JQRatingScale ratingScale = cachedScaleList.Find(ratingScaleID); JQRatingScaleCollection newScaleList = new JQRatingScaleCollection(); if (ratingScale != null) { // account for blank/null instructions ratingScale.RatingScaleInstruction = string.IsNullOrWhiteSpace(ratingScale.RatingScaleInstruction) ? GetLocalResourceObject("MissingInstructionsText").ToString() : ratingScale.RatingScaleInstruction; newScaleList.Add(ratingScale); } e.DetailTableView.DataSource = newScaleList; break; } case "RatingScaleResponses": { long ratingScaleID = (long)dataItem.GetDataKeyValue("RatingScaleID"); RatingScaleResponseCollection responseItemList = this.RatingScaleResponses.FindByScale(ratingScaleID); if (responseItemList.Count == 0) { RatingScaleResponseCollection listResponses = jqm.GetJQRatingScaleResponseCollectionByFactorItemID(ratingScaleID); this.RatingScaleResponses.AddRange(listResponses); responseItemList = listResponses; } e.DetailTableView.DataSource = responseItemList; break; } } } catch (Exception ex) { base.HandleException(ex); } }
public static JQRatingScaleCollection GetJQRatingScale() { JQRatingScaleCollection returnList = null; try { returnList = new JQRatingScaleCollection(ExecuteDataTable("spr_GetAllJQRatingScale")); } catch (Exception ex) { HandleException(ex); } return(returnList); }