private void InitSubitems(IList <object> fields) { this.SubItems.Clear(); for (int idx = 0; idx < fields.Count; idx++) { object value = null; object field = fields[idx]; if (field is SubItemFlag) { SubItemFlag flag = (SubItemFlag)field; switch (flag) { case SubItemFlag.None: value = string.Empty; break; case SubItemFlag.Id: value = JobData.Id; break; case SubItemFlag.Description: value = string.Empty; if (JobData.ContainsKey("Description")) { value = JobData["Description"]; } break; } } if (field is JobField) { JobField jf = field as JobField; value = string.Empty; if ((jf != null) && (JobData.ContainsKey(jf))) { value = JobData[jf]; } } else { value = field; } AddSubitem(value, idx); } }