public UserRow(UserRow TemplateRow) { foreach (KeyValuePair <ULColumnType, string> column in TemplateRow) { Add(column.Key, null); } }
public static void SetColumns(this ListView Owner, UserRow TemplateRow, string Format) { List <ULColumnType> ColIDs = new List <ULColumnType>(); foreach (string sColID in Format.Split(',')) { int ColID = -1; if (int.TryParse(sColID, out ColID)) { ColIDs.Add((ULColumnType)ColID); } } Owner.SetColumns(TemplateRow, ColIDs.ToArray()); }
public static void SetColumns(this ListView Owner, UserRow TemplateRow, ULColumnType[] Format) { UserRow Row = new UserRow(); Row.Add(ULColumnType.Tag, null); foreach (ULColumnType ColumnType in Format) { if (TemplateRow.ContainsKey(ColumnType) && !Row.ContainsKey(ColumnType)) { Row.Add(ColumnType, TemplateRow[ColumnType]); } } Owner.SetColumns(Row); }
public static void SetColumns(this ListView Owner, UserRow Row) { Owner.SuspendLayout(); Owner.BeginUpdate(); Owner.Items.Clear(); Owner.Columns.Clear(); foreach (KeyValuePair <ULColumnType, string> Column in Row) { if (Column.Value != null) { Owner.Columns.Add(Column.Value).Tag = Column.Key; } } CurrentHeaderRow = Row; Owner.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize); Owner.EndUpdate(); Owner.ResumeLayout(); }