//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); 
            
        }
Esempio n. 2
0
        /// <summary>
        /// Initialize a new instance of the GridLayout class.
        /// </summary>
        public GridLayout()
        {
            _columns = new ColumnDefinitionCollection();
            _rows = new RowDefinitionCollection();

            // We need to request a measure/arrange cycle whenever definitions are changed
            _columns.NeedMeasure += new EventHandler(OnNeedMeasure);
            _rows.NeedMeasure += new EventHandler(OnNeedMeasure);
        }
        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);
            }
        }
Esempio n. 4
0
		public Grid ()
		{
			column_definitions = new ColumnDefinitionCollection (this);
			row_definitions = new RowDefinitionCollection (this);
		}