I'm trying to populate an NSTableView with an Image column and some text columns.
At the moment I have populated a purely text columns NSTableView, using the method found in the NSTableView sample in the monomac samples, but I think it might be a big clunky and I'm not sure if I can use this to populate different column types cause it uses a List of NSStrings.
It's something like this:
NSTableColumn showIdColumn = myTableView.FindTableColumn(SHOWID);
showIdColumn.Bind("value",myContentArray,"arrangedObjects.showId",null);
/*
NSTableColumn titleColumn = myTableView.FindTableColumn(TITLE);
titleColumn.Bind("value", myContentArray, "arrangedObjects.title", null);
*/
NSTableColumn dateColumn = myTableView.FindTableColumn(SHOWDATE);
dateColumn.Bind("value", myContentArray, "arrangedObjects.showDate", null);
NSTableColumn comicsColumn = myTableView.FindTableColumn(SHOWCOMICS);
comicsColumn.Bind("value",myContentArray, "arrangedObjects.showComics", null);
foreach (DataRow row in dtShowList.Rows)
{
DateTime d = (DateTime)row["showDate"];
string strDate = d.ToString("ddd, MMM d @ htt");
List<NSString> objects = new List<NSString>
{
new NSString(row["showId"].ToString ()),
new NSString(strDate),
new NSString(row["showComics"].ToString())
//new NSString(row[2].ToString()),
//new NSString(row[3].ToString ())
};
}
var dict = NSMutableDictionary.FromObjectsAndKeys(objects.ToArray(), Keys.ToArray());
myContentArray.AddObject(dict);
Any ideas?