/// <summary> /// Creates a set of table items. /// </summary> protected void CreateTableItems () { List<TableItemGroup> tableItems = new List<TableItemGroup> (); // declare vars TableItemGroup tGroup; // Section 1 tGroup = new TableItemGroup() { Name = "Places" }; tGroup.Items.Add (new TableItem() { CellStyle = cellStyle, CellAccessory = cellAccessory , ImageName = "Images/Beach.png", Heading = "Fiji", SubHeading = "A nice beach" }); tGroup.Items.Add (new TableItem() { CellStyle = cellStyle, CellAccessory = cellAccessory , ImageName = "Images/Shanghai.png", Heading = "Beijing", SubHeading = "AKA Shanghai" }); tableItems.Add (tGroup); // Section 2 tGroup = new TableItemGroup() { Name = "Other" }; tGroup.Items.Add (new TableItem() { CellStyle = cellStyle, CellAccessory = cellAccessory , ImageName = "Images/Seeds.png", Heading = "Seedlings", SubHeading = "Tiny Plants" }); tGroup.Items.Add (new TableItem() { CellStyle = cellStyle, CellAccessory = cellAccessory , ImageName = "Images/Plants.png", Heading = "Plants", SubHeading = "Green plants" }); tableItems.Add (tGroup); tableSource = new TableSource(tableItems); }
/// <summary> /// Creates a set of table items. /// </summary> protected void CreateTableItems () { List<TableItemGroup> tableItems = new List<TableItemGroup> (); // declare vars TableItemGroup tGroup; // Section 1 tGroup = new TableItemGroup() { Name = "Section 0 Header", Footer = "Section 0 Footer" }; tGroup.Items.Add (new TableItem("Row 0")); tGroup.Items.Add (new TableItem("Row 1")); tGroup.Items.Add (new TableItem("Row 2")); tableItems.Add (tGroup); // Section 2 tGroup = new TableItemGroup() { Name = "Section 1 Header", Footer = "Section 1 Footer" }; tGroup.Items.Add (new TableItem("Row 0")); tGroup.Items.Add (new TableItem("Row 1")); tGroup.Items.Add (new TableItem("Row 2")); tableItems.Add (tGroup); // Section 3 tGroup = new TableItemGroup() { Name = "Section 2 Header", Footer = "Section 2 Footer" }; tGroup.Items.Add (new TableItem("Row 0")); tGroup.Items.Add (new TableItem("Row 1")); tGroup.Items.Add (new TableItem("Row 2")); tableItems.Add (tGroup); // For custom cells, comment out the first and uncomment the second. tableSource = new TableSource (tableItems); }