3 writes to _layout
System.Windows.Forms (3)
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (1)
444_layout = new LayoutData
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (2)
4476_layout = newLayout; 4481_layout = newLayout;
302 references to _layout
System.Windows.Forms (302)
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (24)
1670_layout.ColumnHeadersVisible = value; 2469int displayWidth = _layout.Data.Width; 2549int displayHeight = _layout.Data.Height; 2682int widthNotVisible = Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - _layout.Data.Width; 2705Rectangle rectTmp = _layout.Data; 2706if (_layout.ColumnHeadersVisible) 2709rectTmp = Rectangle.Union(rectTmp, _layout.ColumnHeaders); 2804if (value > 0 && (Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - _layout.Data.Width) <= 0) 2976if (_layout._dirty && IsHandleCreated) 2985return _layout; 3359_layout.RowHeadersVisible = value; 3415if (_layout.RowHeadersVisible) 3814if (!_layout._dirty && !DesignMode) 3816Invalidate(Rectangle.Union(_layout.Data, _layout.ColumnHeaders)); 3817Invalidate(_layout.TopLeftHeader); 3867if (!_layout._dirty && !DesignMode) 3869Invalidate(_layout.Data); 3947if (!_layout._dirty && !DesignMode) 3949Invalidate(_layout.RowHeaders); 3956!_layout.ColumnHeadersVisible 3961!_layout.RowHeadersVisible 4071Invalidate(new Rectangle(_layout.Inside.X, _layout.Inside.Y, RowHeadersWidth, ColumnHeadersHeight));
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (276)
494int displayHeight = _layout.Data.Height; 538Debug.Assert(!_layout._dirty); 540if (Columns.GetColumnsWidth(DataGridViewElementStates.Visible) > _layout.Data.Width) 548int availableWidth = _layout.Data.Width; // Width available for auto-filled columns 594int maximumPossibleWidth = _layout.Data.Width - imposedWidthSum; 748int maximumPossibleWidth = _layout.Data.Width - imposedWidthSum; 925Debug.Assert(_layout.Data.Width == _layout.Inside.Width - _layout.RowHeaders.Width - (SingleVerticalBorderAdded ? 1 : 0)); 926int availableWidth = _layout.Data.Width - imposedWidthSum; 939&& _layout.Data.Height > totalVisibleFrozenHeight 940&& SystemInformation.VerticalScrollBarWidth <= _layout.Data.Width) 1320int displayHeight = _layout.Data.Height; 1757if (_layout.TopLeftHeader.Width > 0) 1760? TopLeftHeaderCell.GetPreferredHeight(-1, _layout.TopLeftHeader.Width) 1822if (_layout.TopLeftHeader.Width > 0) 1825? TopLeftHeaderCell.GetPreferredHeight(-1, _layout.TopLeftHeader.Width) 2015if (_layout.TopLeftHeader.Width > 0) 2018? TopLeftHeaderCell.GetPreferredWidth(-1, _layout.TopLeftHeader.Height) 2039int displayHeight = _layout.Data.Height, cy = 0; 2177if (_layout.TopLeftHeader.Width > 0) 2180? TopLeftHeaderCell.GetPreferredWidth(-1, _layout.TopLeftHeader.Height) 2201int displayHeight = _layout.Data.Height, cy = 0; 2431Rectangle clip = Rectangle.Union(_layout.ColumnHeaders, _layout.Data); 2432if (_layout.TopLeftHeader.Width > 0) 2434clip = Rectangle.Union(_layout.TopLeftHeader, clip); 2455Rectangle cursorClip = _layout.ColumnHeaders; 2466cursorClip.Width = Math.Min(frozenWidth, _layout.Data.Width); 2475else if (_layout.Data.Width > frozenWidth + scrollingWidth) 2477cursorClip.X += _layout.Data.Width - frozenWidth - scrollingWidth; 2480cursorClip.Width = Math.Min(scrollingWidth, _layout.Data.Width); 2491Invalidate(_layout.ColumnHeaders); 2537Rectangle clip = Rectangle.Union(_layout.ColumnHeaders, _layout.Data); 2541clip.X = _layout.Data.X - _mouseBarOffset - 1; 2542clip.Width = leftEdge - Columns[columnIndex].MinimumThickness - _layout.Data.X + 3; 2553clip.Width = _layout.Data.Right - leftEdge - 1; 2736Rectangle clip = Rectangle.Union(_layout.RowHeaders, _layout.Data); 2737if (_layout.TopLeftHeader.Width > 0) 2739clip = Rectangle.Union(_layout.TopLeftHeader, clip); 2771Rectangle clip = Rectangle.Union(_layout.RowHeaders, _layout.Data); 2774clip.Height = _layout.Data.Y + _layout.Data.Height - topEdge - 1; 2967Rectangle r, inside = _layout.ColumnHeaders; 2968if (_layout.TopLeftHeader.Width > 0) 2970inside = Rectangle.Union(_layout.TopLeftHeader, inside); 2999Rectangle inside = _layout.Data; 3020Rectangle inside = _layout.Data; 4211if (Columns.GetColumnsWidth(DataGridViewElementStates.Visible | DataGridViewElementStates.Frozen) >= _layout.Data.Width) 4269int displayHeight = _layout.Data.Height - totalVisibleFrozenHeight; 4358LayoutData newLayout = new(_layout); 4359Rectangle oldResizeRect = _layout.ResizeBoxRect; 4382if (_layout.ColumnHeadersVisible) 4396if (_layout.RowHeadersVisible) 4413if (_layout.ColumnHeadersVisible) 4477_layout._dirty = false; 4482Debug.Assert(!_layout._dirty); 4490if (!oldResizeRect.Equals(_layout.ResizeBoxRect) && !_layout.ResizeBoxRect.IsEmpty) 4492Invalidate(_layout.ResizeBoxRect); 4544_vertScrollBar.LargeChange = _layout.Data.Height - totalVisibleFrozenHeight; 4565int displayWidth = _layout.Data.Width, cx = 0; 4717Invalidate(_layout.ColumnHeaders); 4768int displayHeight = _layout.Data.Height; 4920columnX = RightToLeftInternal ? _layout.RowHeaders.Left - 1 : _layout.RowHeaders.Left; 4923rowY = rowIndex > -1 ? GetRowYFromIndex(rowIndex) : _layout.ColumnHeaders.Top; 5519int cxMax = _layout.Data.Width, cx = 0; 5632Rectangle rectInsertionBar = new(0, _layout.ColumnHeaders.Top, InsertionBarWidth, _layout.ColumnHeaders.Height); 5660_layout.ColumnHeaders.X, 5664_layout.ColumnHeaders.Right - InsertionBarWidth); 6046int y = Math.Min(e.Y + _mouseBarOffset, _layout.Data.Bottom - 1); 6047int delta = y - _layout.ColumnHeaders.Y - ColumnHeadersHeight + 1; 6068Invalidate(Rectangle.Union(_layout.TopLeftHeader, _layout.ColumnHeaders)); 6110newX = Math.Max(x + _mouseBarOffset, _layout.Data.X); 6115newX = Math.Min(x + _mouseBarOffset, _layout.Data.Right - 1); 6293x = Math.Max(e.X + _mouseBarOffset, _layout.Data.Left - 1); 6294delta = _layout.RowHeaders.Right - RowHeadersWidth - x - 1; 6298x = Math.Min(e.X + _mouseBarOffset, _layout.Data.Right - 1); 6299delta = x - _layout.RowHeaders.X - RowHeadersWidth + 1; 6325int y = Math.Min(e.Y + _mouseBarOffset, _layout.Data.Bottom - 1); 6395int displayHeight = _layout.Data.Height; 7053columnRect = rowIndex >= 0 ? _layout.RowHeaders : _layout.TopLeftHeader; 7064rowRect = columnIndex >= 0 ? _layout.ColumnHeaders : _layout.TopLeftHeader; 8207Rectangle data = _layout.Data; 8305if (_layout.ColumnHeadersVisible) 8307columnRect.Height += _layout.ColumnHeaders.Height; 8308columnRect.Y -= _layout.ColumnHeaders.Height; 8321Rectangle data = _layout.Data; 8453int x = RightToLeftInternal ? _layout.Data.Right - 1 : _layout.Data.X; 8561Rectangle rectScrollingArea = _layout.Data; 8566int emptyBackgroundWidth = Math.Max(0, _layout.Data.Width - Columns.GetColumnsWidth(DataGridViewElementStates.Visible)); 8567int emptyBackgroundHeight = Math.Max(0, _layout.Data.Height - frozenVisibleRowsHeight - trailingScrollingRowsHeight); 8575if (_layout.RowHeadersVisible) 8578rectScrollingArea = Rectangle.Union(rectScrollingArea, _layout.RowHeaders); 8667if (_layout.ColumnHeadersVisible) 8670rectScrollingArea = Rectangle.Union(rectScrollingArea, _layout.ColumnHeaders); 8825if (mouseY < _layout.Data.Top) 8827mouseY = _layout.Data.Top + 1; 8890if (!RightToLeftInternal && mouseX < _layout.Data.Left) 8892mouseX = _layout.Data.Left + 1; 8895else if (RightToLeftInternal && mouseX > _layout.Data.Right) 8897mouseX = _layout.Data.Right - 1; 9037Rectangle data = _layout.Data; 9090if (_layout.RowHeadersVisible) 9092rowRect.Width += _layout.RowHeaders.Width; 9095rowRect.X -= _layout.RowHeaders.Width; 9107Rectangle data = _layout.Data; 9198int y = _layout.Data.Y; 9285if (!_layout.Inside.Contains(x, y)) 9302if (_layout.TopLeftHeader.Contains(x, y)) 9306hti._colStart = RightToLeftInternal ? _layout.TopLeftHeader.Right - 1 : _layout.TopLeftHeader.Left; 9308hti._rowStart = _layout.TopLeftHeader.Top; 9309if ((!RightToLeftInternal && _layout.TopLeftHeader.Right - x < ColumnSizingHotZone) 9310|| (RightToLeftInternal && x - _layout.TopLeftHeader.Left < ColumnSizingHotZone)) 9317? _layout.TopLeftHeader.Left - x - 1 9318: _layout.TopLeftHeader.Right - x - 1; 9321else if (_layout.TopLeftHeader.Top + _layout.TopLeftHeader.Height - y < RowSizingHotZone) 9327hti._mouseBarOffset = _layout.TopLeftHeader.Top + _layout.TopLeftHeader.Height - y - 1; 9335if (_layout.ColumnHeaders.Contains(x, y)) 9347hti._rowStart = _layout.ColumnHeaders.Top; 9398else if (_layout.ColumnHeaders.Bottom - y < RowSizingHotZone) 9404hti._mouseBarOffset = _layout.ColumnHeaders.Bottom - y - 1; 9410if (_layout.RowHeaders.Contains(x, y)) 9422hti._colStart = RightToLeftInternal ? _layout.RowHeaders.Right - 1 : _layout.RowHeaders.Left; 9462else if ((!RightToLeftInternal && _layout.RowHeaders.Right - x < ColumnSizingHotZone) 9463|| (RightToLeftInternal && x - _layout.RowHeaders.Left < ColumnSizingHotZone)) 9470? _layout.RowHeaders.Left - x - 1 9471: _layout.RowHeaders.Right - x - 1; 9476if (_layout.Data.Contains(x, y)) 9828Invalidate(_layout.Data); 9839Invalidate(_layout.Inside); 9896data = _layout.Data; 10169&& totalVisibleWidth > _layout.Data.Width 10170&& totalVisibleFrozenWidth < _layout.Data.Width 10171&& horizScrollBarHeight <= _layout.Data.Height) 10173int oldDataHeight = _layout.Data.Height; 10174_layout.Data.Height -= horizScrollBarHeight; 10175Debug.Assert(_layout.Data.Height >= 0); 10177if (totalVisibleWidth - _layout.Data.Width <= vertScrollBarWidth 10178|| _layout.Data.Width - totalVisibleFrozenWidth <= vertScrollBarWidth) 10187needHorizScrollbar = totalVisibleFrozenWidth < _layout.Data.Width - vertScrollBarWidth; 10195if (_layout.RowHeadersVisible) 10197_layout.RowHeaders.Height -= horizScrollBarHeight; 10198Debug.Assert(_layout.RowHeaders.Height >= 0); 10204_layout.Data.Height = oldDataHeight; 10215&& _layout.Data.Height > totalVisibleFrozenHeight 10216&& vertScrollBarWidth <= _layout.Data.Width) 10218_layout.Data.Width -= vertScrollBarWidth; 10219Debug.Assert(_layout.Data.Width >= 0); 10222_layout.Data.X += vertScrollBarWidth; 10225if (_layout.ColumnHeadersVisible) 10227_layout.ColumnHeaders.Width -= vertScrollBarWidth; 10228Debug.Assert(_layout.ColumnHeaders.Width >= 0); 10231_layout.ColumnHeaders.X += vertScrollBarWidth; 10245&& totalVisibleWidth > _layout.Data.Width && totalVisibleFrozenWidth < _layout.Data.Width 10246&& horizScrollBarHeight <= _layout.Data.Height) 10249if (_layout.ColumnHeadersVisible) 10251_layout.ColumnHeaders.Width += vertScrollBarWidth; 10254_layout.ColumnHeaders.X -= vertScrollBarWidth; 10258_layout.Data.Width += vertScrollBarWidth; 10261_layout.Data.X -= vertScrollBarWidth; 10264_layout.Data.Height -= horizScrollBarHeight; 10265Debug.Assert(_layout.Data.Height >= 0); 10272&& _layout.Data.Height > totalVisibleFrozenHeight 10273&& vertScrollBarWidth <= _layout.Data.Width) 10275_layout.Data.Width -= vertScrollBarWidth; 10276Debug.Assert(_layout.Data.Width >= 0); 10279_layout.Data.X += vertScrollBarWidth; 10282if (_layout.ColumnHeadersVisible) 10284_layout.ColumnHeaders.Width -= vertScrollBarWidth; 10285Debug.Assert(_layout.ColumnHeaders.Width >= 0); 10288_layout.ColumnHeaders.X += vertScrollBarWidth; 10298_layout.ResizeBoxRect = default; 10301_layout.ResizeBoxRect = new Rectangle( 10302rightToLeftInternal ? _layout.Data.X - _vertScrollBar.Width : _layout.Data.Right, 10303_layout.Data.Bottom, 10310int widthNotVisible = totalVisibleWidth - _layout.Data.Width; 10319rightToLeftInternal ? _layout.Inside.X + _layout.ResizeBoxRect.Width : _layout.Inside.X, 10320_layout.Data.Bottom, 10321_layout.Inside.Width - _layout.ResizeBoxRect.Width, 10341int vertScrollBarTop = _layout.Data.Y; 10342int vertScrollBarHeight = _layout.Data.Height; 10343if (_layout.ColumnHeadersVisible) 10345vertScrollBarTop = _layout.ColumnHeaders.Y; 10346vertScrollBarHeight += _layout.ColumnHeaders.Height; 10358_vertScrollBar.LargeChange = _layout.Data.Height - totalVisibleFrozenHeight; 10360rightToLeftInternal ? _layout.Data.X - _vertScrollBar.Width : _layout.Data.Right, 10489Invalidate(Rectangle.Union(_layout.TopLeftHeader, _layout.ColumnHeaders)); 13447Invalidate(Rectangle.Union(_layout.ColumnHeaders, _layout.Data)); 13910Invalidate(Rectangle.Union(_layout.TopLeftHeader, _layout.ColumnHeaders)); 14487Rectangle rightArea = _layout.Data; 14488if (_layout.ColumnHeadersVisible) 14490rightArea = Rectangle.Union(rightArea, _layout.ColumnHeaders); 15220if (_layout._dirty) 16668if (_layout._dirty) 16698PaintBorder(g, clipRect, _layout.ClientRectangle); 16699if (clipRect.IntersectsWith(_layout.ResizeBoxRect)) 16701g.FillRectangle(SystemBrushes.Control, _layout.ResizeBoxRect); 16737Rectangle gridRect = _layout.Data; 16738if (_layout.RowHeadersVisible) 16740gridRect = Rectangle.Union(gridRect, _layout.RowHeaders); 16752if (_layout.ColumnHeadersVisible) 16754gridRect = Rectangle.Union(gridRect, _layout.ColumnHeaders); 16758if (gridRect.Y == _layout.Data.Y) 17437Rectangle oldClientRectangle = _layout.ClientRectangle; 17498if (!_layout.ResizeBoxRect.IsEmpty) 17500Invalidate(_layout.ResizeBoxRect); 17503_layout.ClientRectangle = newClientRectangle; 18184Invalidate(Rectangle.Union(_layout.TopLeftHeader, _layout.RowHeaders)); 19208if (_layout.ColumnHeadersVisible) 19210rcBelowRows.Y += _layout.ColumnHeaders.Height; 19211rcBelowRows.Height -= _layout.ColumnHeaders.Height; 19233if (_layout.RowHeadersVisible) 19237rcNextRows.X += _layout.RowHeaders.Width; 19240rcNextRows.Width -= _layout.RowHeaders.Width; 19335if (g.IsVisible(_layout.ColumnHeaders)) 19338bandBounds = cellBounds = _layout.ColumnHeaders; 19494if (_layout.TopLeftHeader.Width > 0 && (clipRect.IntersectsWith(_layout.TopLeftHeader) || _lastHeaderShadow != -1)) 19499g.SetClip(_layout.TopLeftHeader); 19505if (_layout.ColumnHeadersVisible) 19507Rectangle columnHeadersClip = _layout.ColumnHeaders; 19521int columnHeadersHeight = _layout.ColumnHeaders.Height; 19674if (g.IsVisible(_layout.TopLeftHeader)) 19679Rectangle cellBounds = _layout.TopLeftHeader; 19685_layout.TopLeftHeader, 19755_layout?._dirty = true; 19804Rectangle editingZone = _layout.Data; 25541bool matchPositionInCurrencyManagerAfterRecreatingRows = !_layout._dirty && !InSortOperation; 25863Invalidate(Rectangle.Union(_layout.TopLeftHeader, _layout.ColumnHeaders)); 26056while (xColumnRightEdge < _layout.Data.X && Columns.DisplayInOrder(firstDisplayedScrollingColumn, columnIndex)) 26065if (xColumnRightEdge < _layout.Data.X) 26077while (xColumnRightEdge > _layout.Data.Right && Columns.DisplayInOrder(firstDisplayedScrollingColumn, columnIndex)) 26086if (xColumnRightEdge > _layout.Data.Right) 26285while (yRowBottomEdge > _layout.Data.Bottom && rowIndex > firstDisplayedScrollingRow) 26289if (yRowBottomEdge > _layout.Data.Bottom) 26328Rectangle rowsRect = _layout.Data; 26329if (_layout.RowHeadersVisible) 26331rowsRect = Rectangle.Union(rowsRect, _layout.RowHeaders); 26368rowsRect.X = _layout.Inside.X; 26369rowsRect.Y = _layout.Inside.Y; 26370rowsRect.Width = _layout.RowHeaders.Width; 26723if (_layout.ColumnHeadersVisible) 28931if (IsHandleCreated && _layout.RowHeadersVisible) 28947if (IsHandleCreated && _layout.RowHeadersVisible) 28955Invalidate(_layout.RowHeaders); 28999Rectangle bottomArea = _layout.Data; 29000if (_layout.RowHeadersVisible) 29002bottomArea = Rectangle.Union(bottomArea, _layout.RowHeaders); 29074Rectangle bottomArea = _layout.Data; 29075if (_layout.RowHeadersVisible) 29077bottomArea = Rectangle.Union(bottomArea, _layout.RowHeaders);
System\Windows\Forms\Controls\DataGridView\DataGridView.TopRowAccessibleObject.cs (2)
37Rectangle rect = Rectangle.Union(_ownerDataGridView._layout.ColumnHeaders, _ownerDataGridView._layout.TopLeftHeader);