/// <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); }
/// <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() { ImageName = "Images/Beach.png" , Heading = "Fiji", SubHeading = "A nice beach" }); tGroup.Items.Add (new TableItem() { ImageName = "Images/Shanghai.png" , Heading = "Beijing", SubHeading = "AKA Shanghai" }); tableItems.Add (tGroup); // Section 2 tGroup = new TableItemGroup() { Name = "Other" }; tGroup.Items.Add (new TableItem() { ImageName = "Images/Seeds.png" , Heading = "Seedlings", SubHeading = "Tiny Plants" }); tGroup.Items.Add (new TableItem() { ImageName = "Images/Plants.png" , Heading = "Plants", SubHeading = "Green plants" }); tableItems.Add (tGroup); // For custom cells, comment out the first and uncomment the second. tableSource = new CustomCellTableSource(tableItems); }
/// <summary> /// Creates a set of table items. /// </summary> protected void CreateTableItems () { List<TableItemGroup> tableItems = new List<TableItemGroup> (); Dictionary<string, int> indexSectionMap = new Dictionary<string, int>(); // declare vars TableItemGroup tGroup; // Section tGroup = new TableItemGroup() { Name = "A"}; tGroup.Items.Add (new TableItem("Apple")); tGroup.Items.Add (new TableItem("Artichoke")); tableItems.Add (tGroup); indexSectionMap["A"] = 0; // Section tGroup = new TableItemGroup() { Name = "B"}; tGroup.Items.Add (new TableItem("Banana")); tGroup.Items.Add (new TableItem("Berries")); tableItems.Add (tGroup); indexSectionMap["B"] = 1; // Section tGroup = new TableItemGroup() { Name = "C"}; tGroup.Items.Add (new TableItem("Cucumber")); tGroup.Items.Add (new TableItem("Cantalopes")); tableItems.Add (tGroup); indexSectionMap["C"] = 2; // Section tGroup = new TableItemGroup() { Name = "D"}; tGroup.Items.Add (new TableItem("Daikon")); tableItems.Add (tGroup); indexSectionMap["D"] = 3; // Section tGroup = new TableItemGroup() { Name = "E"}; tGroup.Items.Add (new TableItem("Eggplant")); tGroup.Items.Add (new TableItem("Elderberry")); tableItems.Add (tGroup); indexSectionMap["E"] = 4; // Section tGroup = new TableItemGroup() { Name = "F"}; tGroup.Items.Add (new TableItem("Fig")); tableItems.Add (tGroup); indexSectionMap["F"] = 5; // Section tGroup = new TableItemGroup() { Name = "G"}; tGroup.Items.Add (new TableItem("Grape")); tGroup.Items.Add (new TableItem("Guava")); tableItems.Add (tGroup); indexSectionMap["G"] = 6; // Section tGroup = new TableItemGroup() { Name = "H"}; tGroup.Items.Add (new TableItem("Honeydew")); tGroup.Items.Add (new TableItem("Huckleberry")); tableItems.Add (tGroup); indexSectionMap["H"] = 7; // Section tGroup = new TableItemGroup() { Name = "I"}; tGroup.Items.Add (new TableItem("Indian Fig")); tableItems.Add (tGroup); indexSectionMap["I"] = 8; // Section tGroup = new TableItemGroup() { Name = "J"}; tGroup.Items.Add (new TableItem("Jackfruit")); tableItems.Add (tGroup); indexSectionMap["J"] = 9; // Section tGroup = new TableItemGroup() { Name = "K"}; tGroup.Items.Add (new TableItem("Kiwi")); tGroup.Items.Add (new TableItem("Kumquat")); tableItems.Add (tGroup); indexSectionMap["K"] = 10; indexSectionMap["L"] = 10; indexSectionMap["M"] = 10; indexSectionMap["N"] = 10; indexSectionMap["O"] = 10; indexSectionMap["P"] = 10; indexSectionMap["Q"] = 10; indexSectionMap["R"] = 10; indexSectionMap["S"] = 10; indexSectionMap["T"] = 10; indexSectionMap["U"] = 10; indexSectionMap["V"] = 10; indexSectionMap["W"] = 10; indexSectionMap["X"] = 10; indexSectionMap["Y"] = 10; indexSectionMap["Z"] = 10; // For custom cells, comment out the first and uncomment the second. tableSource = new TableSourceWithIndex(tableItems, indexSectionMap); }