void LoadData(List <List <string> > values) { Text CellTemp; //Data foreach (List <string> ls in values) { foreach (string s in ls) { CellTemp = Instantiate <Text>(TextfieldRef, DataTransform); CellTemp.GetComponent <Text>().text = s; CellTemp.fontStyle = FontStyle.Normal; CellTemp.gameObject.SetActive(true); } } // DataTransform.gameObject.GetComponent <GridLayoutGroup>().constraintCount = HeadersColumnsCount; DataTransform.gameObject.GetComponent <GridLayoutGroup>().childAlignment = TextAnchor.UpperLeft; }
void LoadHeaders(string[] titles) { //Transform HeaderTransform = transform.GetChild(1).GetChild(0).transform; //string[] titles = jr.GetColumnTitles(); //ColumnHeaders Text CellTemp; foreach (string s in titles) { CellTemp = Instantiate <Text>(TextfieldRef, HeaderTransform); CellTemp.GetComponent <Text>().text = s; CellTemp.fontStyle = FontStyle.Bold; CellTemp.gameObject.SetActive(true); } // HeaderTransform.gameObject.GetComponent <GridLayoutGroup>().constraintCount = titles.Length; HeaderTransform.gameObject.GetComponent <GridLayoutGroup>().childAlignment = TextAnchor.UpperLeft; }