public void OpenMakeList(object sender, EventArgs e) { UIButton btnMakeSearch = (UIButton)sender; ScreenUtils scnUtils = new ScreenUtils (); scnUtils.GetAbsolutePosition (btnMakeSearch); float iTop = scnUtils.GetPositionTop (); float iLeft = scnUtils.GetPositionLeft (); int iBtnTagId = btnMakeSearch.Tag; int iPwrIdRow = iBtnTagId / iEquipmentMakeSearchTagId; int iStringRow = iBtnTagId - (iPwrIdRow * iEquipmentMakeSearchTagId); int iSectionCounterTagId = iEquipmentRowSectionCounterTagId * iPwrIdRow + iStringRow; UILabel hfSectionCounter = (UILabel)View.ViewWithTag (iSectionCounterTagId); int iSectionCounterId = Convert.ToInt32(hfSectionCounter.Text); //Create a list and convert the string array to the list. Why the system cannot take a simple string arary is beyond me!!! UILabel lblEquipmentType = (UILabel)View.ViewWithTag (iEquipmentTypeTagId * (iPwrIdRow) + (iStringRow)); int iEquipmentType = Convert.ToInt32(lblEquipmentType.Text); List<string> mylist = new List<string> (); clsTabletDB.ITPInventory ITPInventory = new clsTabletDB.ITPInventory (); string[] sMakes; switch(iEquipmentType) { case 3: sMakes = ITPInventory.GetRackMakes (); m_sRackMakes = sMakes; Array.ForEach (m_sRackMakes, value => mylist.Add (value.ToString ())); break; case 4: sMakes = ITPInventory.GetSubRackMakes (); m_sSubRackMakes = sMakes; Array.ForEach (m_sSubRackMakes, value => mylist.Add (value.ToString ())); break; case 5: sMakes = ITPInventory.GetPositionMakes (); m_sPositionMakes = sMakes; Array.ForEach (m_sPositionMakes, value => mylist.Add (value.ToString ())); break; case 7: sMakes = ITPInventory.GetSolarStringMakes (); m_sSolarStringMakes = sMakes; Array.ForEach (m_sSolarStringMakes, value => mylist.Add (value.ToString ())); break; default: sMakes = ITPInventory.GetPositionMakes (); m_sPositionMakes = sMakes; Array.ForEach (m_sPositionMakes, value => mylist.Add (value.ToString ())); break; } TableViewSource tabdata = new TableViewSource (mylist, true); tabdata.SetFont("Verdana",10f); UITableView cmbMake = new UITableView (); //If the bottom of the frame would be outside the main content frame make it go upwards instead of downwards UILabel hfContentHeight = (UILabel)View.ViewWithTag (3); int iContentHeight = Convert.ToInt32 (hfContentHeight.Text); if (iTop + 190f > (float)iContentHeight) { cmbMake.Frame = new RectangleF(iLeft, iTop - 190f, 290f, 200f); } else { cmbMake.Frame = new RectangleF(iLeft, iTop, 290f, 200f); } tabdata.SetParent(cmbMake); tabdata.SetUpdateFieldType("UILabel"); UILabel txtVwUpdate = (UILabel)View.ViewWithTag (iEquipmentMakeTagId * (iPwrIdRow) + (iStringRow)); tabdata.SetLabelViewToUpdate(txtVwUpdate); UIView vwUnsaved = (UIView)View.ViewWithTag (60); tabdata.SetUnsavedChangesView(vwUnsaved); tabdata.SetShowUnsavedOnChange(true); //Also set the section flag to 1 that it has changed and the overall flag that it has changed UILabel lblUnsavedFlag = (UILabel)View.ViewWithTag (80); tabdata.SetUnsavedChangesHiddenLabel(lblUnsavedFlag); UIButton btnSectionSave = (UIButton)View.ViewWithTag ((iSectionCounterId + 1) * iSaveSectionBtnTagId); tabdata.SetSectionSaveButton(btnSectionSave); UILabel lblUnsavedSectionFlag = (UILabel)View.ViewWithTag ((iSectionCounterId + 1) * iSectionStatusTagId); tabdata.SetUnsavedChangesSectionHiddenLabel(lblUnsavedSectionFlag); UILabel lblViewModel = (UILabel)View.ViewWithTag (iEquipmentModelTagId * (iPwrIdRow) + (iStringRow)); tabdata.SetMakePostUpdate(1, lblViewModel); cmbMake.Source = tabdata; iUtils.SESTable thistable = new iUtils.SESTable(); string sSelectedValue = txtVwUpdate.Text; switch(iEquipmentType) { case 3: thistable.SetTableSelectedText(cmbMake, sSelectedValue, m_sRackMakes, true); break; case 4: thistable.SetTableSelectedText(cmbMake, sSelectedValue, m_sSubRackMakes, true); break; case 5: thistable.SetTableSelectedText(cmbMake, sSelectedValue, m_sPositionMakes, true); break; case 7: thistable.SetTableSelectedText(cmbMake, sSelectedValue, m_sSolarStringMakes, true); break; default: thistable.SetTableSelectedText(cmbMake, sSelectedValue, m_sPositionMakes, true); break; } //Get the main scroll view UIScrollView scrollVw = (UIScrollView)View.ViewWithTag (2); scrollVw.AddSubview(cmbMake); }