//Grid bat dau voi 3 row. // row dau va row cuoi co chieu cao mac dinh la 30 // row thu 2 co chieu cao la auto, row thu 2 nay danh cho 'cau hoi'(textblock) private void InitGrid() { rowDefCollection = LayoutRoot.RowDefinitions; RowDefinition rowDef; rowDef = new RowDefinition(); rowDef.Height = new GridLength(10.00); rowDefCollection.Add(rowDef); for (int i = 0; i < iNumOption + 1; ++i) { rowDef = new RowDefinition(); GridLength gridLength = new GridLength(); rowDef.Height = gridLength; rowDef.MinHeight = 30.00; rowDefCollection.Add(rowDef); } rowDef = new RowDefinition(); rowDef.Height = new GridLength(10.00); rowDefCollection.Add(rowDef); }
private void InitGrid() { gridChildLayout = new Grid(); LayoutRoot.Content = gridChildLayout; gridChildLayout.VerticalAlignment = VerticalAlignment.Top; gridChildLayout.HorizontalAlignment = HorizontalAlignment.Left; gridChildLayout.ShowGridLines = true; rowDefCollection = gridChildLayout.RowDefinitions; for (int i = 0; i < iNumItem + 1; ++i) { RowDefinition rowDef = new RowDefinition(); rowDefCollection.Add(rowDef); } }