www.pudn.com > ObjectListViewDemo.zip
To Read all the content
[file head]:
/*
* ObjectListView - A listview to show various aspects of a collection of objects
*
* Author: Phillip Piper
* Date: 9/10/2006 11:15 AM
*
* Change log:
* v1.10
* 2008-03-25 JPP - Added space filling columns. See OLVColumn.FreeSpaceProportion property for details.
* A space filling columns fills all (or a portion) of the width unoccupied by other columns.
* 2008-03-23 JPP - Finished tinkering with support for Mono. Compile with conditional compilation symbol 'MONO'
* to enable. Current problems with Mono:
* - grid lines on virtual lists crashes
* - when grouped, items sometimes are not drawn when any item is scrolled out of view
* - i can't seem to get owner drawing to work
* - when editing cell values, the editing controls always appear behind the listview,
* where they function fine -- the user just can't see them
... ...
[file tail]:
... ...
ysInOrder.Add(k2);
}
public override void Render(Graphics g, Rectangle r)
{
this.DrawBackground(g, r);
UInt32 v2 = ((IConvertible)this.Aspect).ToUInt32(NumberFormatInfo.InvariantInfo);
Point pt = r.Location;
foreach (UInt32 key in this.keysInOrder) {
if ((v2 &amt; key) == key) {
Image image = this.GetImage(this.imageMap[key]);
if (image != null) {
g.DrawImage(image, pt);
pt.X += (image.Width + this.Spacing);
}
}
}
}
/// <summary>
/// Get or set the number of pixels between each image
/// </summary>
public int Spacing = 1;
private List<UInt32> keysInOrder = new List<UInt32>();
private Dictionary<UInt32, Object> imageMap = new Dictionary<UInt32, object>();
}
#endregion
}