Welcome Guest! You need to login or register to make posts.



Go to last post Go to first unread
#1 Posted : Sunday, May 14, 2006 12:42:02 PM(UTC)

Rank: Member

Groups: Member
Joined: 5/14/2006(UTC)
Posts: 1

Hi there,

I'm currently evaluating the product.

Have followed your example about creating custom list items. All I want to do is to add a couple of custom columns, is there an easy way to do this, and could someone provide me with some sample code if possible?



Alex Kon  
#2 Posted : Sunday, May 14, 2006 5:38:40 PM(UTC)
Alex Kon

Rank: Advanced Member

Groups: Member
Joined: 1/31/2005(UTC)
Posts: 458

Was thanked: 5 time(s) in 5 post(s)
Hi, Jamie,

If you want just to add some columns you can inherit your custom list item class from the Aurigma.GraphicsMill.WinControls.ThumbnailListItem class and overload GetText method only. You can use the following code snippet as base for your code:

public class CustomThumbItem: Aurigma.GraphicsMill.WinControls.ThumbnailListItem
	public CustomThumbItem(string path, string additionalText)
		: base(path)
		_additionalText = additionalText;

	public override string GetText(int textInfoId)
		if (textInfoId != 40 /*your custom TextID*/)
			return base.GetText (textInfoId);
			return _additionalText;

	private string _additionalText;
And, for example, you can use this implementation of the IListItem in such way:
thumbnailListView1.Columns.Add(new Aurigma.GraphicsMill.WinControls.ListColumn(40/*your custom TextID*/, "CustomField", 300, System.Windows.Forms.HorizontalAlignment.Center));

string[] filenames = System.IO.Directory.GetFiles(@"x:\allFormats");
CustomThumbItem[] items = new CustomThumbItem[filenames.Length];

int i = 0;
foreach (string filename in filenames)
	string additionalInfo;
		Aurigma.GraphicsMill.Bitmap image = new Aurigma.GraphicsMill.Bitmap(filename);
		additionalInfo = string.Format("Image: {0}x{1} {2}", image.Width, image.Height, image.PixelFormat);
		additionalInfo = "Cannot load specified file.";

	items[i++] = new CustomThumbItem(filename, additionalInfo);


Edited by user Thursday, December 20, 2007 4:34:05 PM(UTC)  | Reason: Not specified

Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.