/// <summary> /// Post process columns after creating them and adding them to the AllColumns collection. /// </summary> /// <param name="olv"></param> public virtual void PostCreateColumns(ObjectListView olv) { if (olv.AllColumns.Exists(delegate(OLVColumn x) { return(x.CheckBoxes); })) { olv.UseSubItemCheckBoxes = true; } if (olv.AllColumns.Exists(delegate(OLVColumn x) { return(x.Index > 0 && (x.ImageGetter != null || !String.IsNullOrEmpty(x.ImageAspectName))); })) { olv.ShowImagesOnSubItems = true; } olv.RebuildColumns(); olv.AutoSizeColumns(); }
static private void ReplaceColumns(ObjectListView olv, IList<OLVColumn> columns) { olv.Clear(); olv.AllColumns.Clear(); olv.PrimarySortColumn = null; olv.SecondarySortColumn = null; if (columns.Count > 0) { olv.AllColumns.AddRange(columns); olv.RebuildColumns(); } }
/// <summary> /// Post process columns after creating them and adding them to the AllColumns collection. /// </summary> /// <param name="olv"></param> public virtual void PostCreateColumns(ObjectListView olv) { if (olv.AllColumns.Exists(delegate(OLVColumn x) { return x.CheckBoxes; })) olv.UseSubItemCheckBoxes = true; if (olv.AllColumns.Exists(delegate(OLVColumn x) { return x.Index > 0 && (x.ImageGetter != null || !String.IsNullOrEmpty(x.ImageAspectName)); })) olv.ShowImagesOnSubItems = true; olv.RebuildColumns(); olv.AutoSizeColumns(); }