3 writes to _layout
System.Windows.Forms (3)
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (1)
448_layout = new LayoutData
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (2)
4479_layout = newLayout; 4484_layout = newLayout;
303 references to _layout
System.Windows.Forms (303)
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (24)
1664_layout.ColumnHeadersVisible = value; 2462int displayWidth = _layout.Data.Width; 2542int displayHeight = _layout.Data.Height; 2675int widthNotVisible = Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - _layout.Data.Width; 2698Rectangle rectTmp = _layout.Data; 2699if (_layout.ColumnHeadersVisible) 2702rectTmp = Rectangle.Union(rectTmp, _layout.ColumnHeaders); 2797if (value > 0 && (Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - _layout.Data.Width) <= 0) 2969if (_layout._dirty && IsHandleCreated) 2978return _layout; 3352_layout.RowHeadersVisible = value; 3408if (_layout.RowHeadersVisible) 3807if (!_layout._dirty && !DesignMode) 3809Invalidate(Rectangle.Union(_layout.Data, _layout.ColumnHeaders)); 3810Invalidate(_layout.TopLeftHeader); 3860if (!_layout._dirty && !DesignMode) 3862Invalidate(_layout.Data); 3940if (!_layout._dirty && !DesignMode) 3942Invalidate(_layout.RowHeaders); 3949!_layout.ColumnHeadersVisible 3954!_layout.RowHeadersVisible 4070Invalidate(new Rectangle(_layout.Inside.X, _layout.Inside.Y, RowHeadersWidth, ColumnHeadersHeight));
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (277)
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; 2739Rectangle clip = Rectangle.Union(_layout.RowHeaders, _layout.Data); 2740if (_layout.TopLeftHeader.Width > 0) 2742clip = Rectangle.Union(_layout.TopLeftHeader, clip); 2774Rectangle clip = Rectangle.Union(_layout.RowHeaders, _layout.Data); 2777clip.Height = _layout.Data.Y + _layout.Data.Height - topEdge - 1; 2970Rectangle r, inside = _layout.ColumnHeaders; 2971if (_layout.TopLeftHeader.Width > 0) 2973inside = Rectangle.Union(_layout.TopLeftHeader, inside); 3002Rectangle inside = _layout.Data; 3023Rectangle inside = _layout.Data; 4214if (Columns.GetColumnsWidth(DataGridViewElementStates.Visible | DataGridViewElementStates.Frozen) >= _layout.Data.Width) 4272int displayHeight = _layout.Data.Height - totalVisibleFrozenHeight; 4361LayoutData newLayout = new(_layout); 4362Rectangle oldResizeRect = _layout.ResizeBoxRect; 4385if (_layout.ColumnHeadersVisible) 4399if (_layout.RowHeadersVisible) 4416if (_layout.ColumnHeadersVisible) 4480_layout._dirty = false; 4485Debug.Assert(!_layout._dirty); 4493if (!oldResizeRect.Equals(_layout.ResizeBoxRect) && !_layout.ResizeBoxRect.IsEmpty) 4495Invalidate(_layout.ResizeBoxRect); 4547_vertScrollBar.LargeChange = _layout.Data.Height - totalVisibleFrozenHeight; 4568int displayWidth = _layout.Data.Width, cx = 0; 4720Invalidate(_layout.ColumnHeaders); 4771int displayHeight = _layout.Data.Height; 4923columnX = RightToLeftInternal ? _layout.RowHeaders.Left - 1 : _layout.RowHeaders.Left; 4926rowY = rowIndex > -1 ? GetRowYFromIndex(rowIndex) : _layout.ColumnHeaders.Top; 5522int cxMax = _layout.Data.Width, cx = 0; 5635Rectangle rectInsertionBar = new(0, _layout.ColumnHeaders.Top, InsertionBarWidth, _layout.ColumnHeaders.Height); 5663_layout.ColumnHeaders.X, 5667_layout.ColumnHeaders.Right - InsertionBarWidth); 6049int y = Math.Min(e.Y + _mouseBarOffset, _layout.Data.Bottom - 1); 6050int delta = y - _layout.ColumnHeaders.Y - ColumnHeadersHeight + 1; 6071Invalidate(Rectangle.Union(_layout.TopLeftHeader, _layout.ColumnHeaders)); 6113newX = Math.Max(x + _mouseBarOffset, _layout.Data.X); 6118newX = Math.Min(x + _mouseBarOffset, _layout.Data.Right - 1); 6296x = Math.Max(e.X + _mouseBarOffset, _layout.Data.Left - 1); 6297delta = _layout.RowHeaders.Right - RowHeadersWidth - x - 1; 6301x = Math.Min(e.X + _mouseBarOffset, _layout.Data.Right - 1); 6302delta = x - _layout.RowHeaders.X - RowHeadersWidth + 1; 6328int y = Math.Min(e.Y + _mouseBarOffset, _layout.Data.Bottom - 1); 6398int displayHeight = _layout.Data.Height; 7056columnRect = rowIndex >= 0 ? _layout.RowHeaders : _layout.TopLeftHeader; 7067rowRect = columnIndex >= 0 ? _layout.ColumnHeaders : _layout.TopLeftHeader; 8210Rectangle data = _layout.Data; 8308if (_layout.ColumnHeadersVisible) 8310columnRect.Height += _layout.ColumnHeaders.Height; 8311columnRect.Y -= _layout.ColumnHeaders.Height; 8324Rectangle data = _layout.Data; 8456int x = RightToLeftInternal ? _layout.Data.Right - 1 : _layout.Data.X; 8564Rectangle rectScrollingArea = _layout.Data; 8569int emptyBackgroundWidth = Math.Max(0, _layout.Data.Width - Columns.GetColumnsWidth(DataGridViewElementStates.Visible)); 8570int emptyBackgroundHeight = Math.Max(0, _layout.Data.Height - frozenVisibleRowsHeight - trailingScrollingRowsHeight); 8578if (_layout.RowHeadersVisible) 8581rectScrollingArea = Rectangle.Union(rectScrollingArea, _layout.RowHeaders); 8670if (_layout.ColumnHeadersVisible) 8673rectScrollingArea = Rectangle.Union(rectScrollingArea, _layout.ColumnHeaders); 8828if (mouseY < _layout.Data.Top) 8830mouseY = _layout.Data.Top + 1; 8893if (!RightToLeftInternal && mouseX < _layout.Data.Left) 8895mouseX = _layout.Data.Left + 1; 8898else if (RightToLeftInternal && mouseX > _layout.Data.Right) 8900mouseX = _layout.Data.Right - 1; 9040Rectangle data = _layout.Data; 9093if (_layout.RowHeadersVisible) 9095rowRect.Width += _layout.RowHeaders.Width; 9098rowRect.X -= _layout.RowHeaders.Width; 9110Rectangle data = _layout.Data; 9201int y = _layout.Data.Y; 9288if (!_layout.Inside.Contains(x, y)) 9305if (_layout.TopLeftHeader.Contains(x, y)) 9309hti._colStart = RightToLeftInternal ? _layout.TopLeftHeader.Right - 1 : _layout.TopLeftHeader.Left; 9311hti._rowStart = _layout.TopLeftHeader.Top; 9312if ((!RightToLeftInternal && _layout.TopLeftHeader.Right - x < ColumnSizingHotZone) 9313|| (RightToLeftInternal && x - _layout.TopLeftHeader.Left < ColumnSizingHotZone)) 9320? _layout.TopLeftHeader.Left - x - 1 9321: _layout.TopLeftHeader.Right - x - 1; 9324else if (_layout.TopLeftHeader.Top + _layout.TopLeftHeader.Height - y < RowSizingHotZone) 9330hti._mouseBarOffset = _layout.TopLeftHeader.Top + _layout.TopLeftHeader.Height - y - 1; 9338if (_layout.ColumnHeaders.Contains(x, y)) 9350hti._rowStart = _layout.ColumnHeaders.Top; 9401else if (_layout.ColumnHeaders.Bottom - y < RowSizingHotZone) 9407hti._mouseBarOffset = _layout.ColumnHeaders.Bottom - y - 1; 9413if (_layout.RowHeaders.Contains(x, y)) 9425hti._colStart = RightToLeftInternal ? _layout.RowHeaders.Right - 1 : _layout.RowHeaders.Left; 9465else if ((!RightToLeftInternal && _layout.RowHeaders.Right - x < ColumnSizingHotZone) 9466|| (RightToLeftInternal && x - _layout.RowHeaders.Left < ColumnSizingHotZone)) 9473? _layout.RowHeaders.Left - x - 1 9474: _layout.RowHeaders.Right - x - 1; 9479if (_layout.Data.Contains(x, y)) 9831Invalidate(_layout.Data); 9842Invalidate(_layout.Inside); 9899data = _layout.Data; 10172&& totalVisibleWidth > _layout.Data.Width 10173&& totalVisibleFrozenWidth < _layout.Data.Width 10174&& horizScrollBarHeight <= _layout.Data.Height) 10176int oldDataHeight = _layout.Data.Height; 10177_layout.Data.Height -= horizScrollBarHeight; 10178Debug.Assert(_layout.Data.Height >= 0); 10180if (totalVisibleWidth - _layout.Data.Width <= vertScrollBarWidth 10181|| _layout.Data.Width - totalVisibleFrozenWidth <= vertScrollBarWidth) 10190needHorizScrollbar = totalVisibleFrozenWidth < _layout.Data.Width - vertScrollBarWidth; 10198if (_layout.RowHeadersVisible) 10200_layout.RowHeaders.Height -= horizScrollBarHeight; 10201Debug.Assert(_layout.RowHeaders.Height >= 0); 10207_layout.Data.Height = oldDataHeight; 10218&& _layout.Data.Height > totalVisibleFrozenHeight 10219&& vertScrollBarWidth <= _layout.Data.Width) 10221_layout.Data.Width -= vertScrollBarWidth; 10222Debug.Assert(_layout.Data.Width >= 0); 10225_layout.Data.X += vertScrollBarWidth; 10228if (_layout.ColumnHeadersVisible) 10230_layout.ColumnHeaders.Width -= vertScrollBarWidth; 10231Debug.Assert(_layout.ColumnHeaders.Width >= 0); 10234_layout.ColumnHeaders.X += vertScrollBarWidth; 10248&& totalVisibleWidth > _layout.Data.Width && totalVisibleFrozenWidth < _layout.Data.Width 10249&& horizScrollBarHeight <= _layout.Data.Height) 10252if (_layout.ColumnHeadersVisible) 10254_layout.ColumnHeaders.Width += vertScrollBarWidth; 10257_layout.ColumnHeaders.X -= vertScrollBarWidth; 10261_layout.Data.Width += vertScrollBarWidth; 10264_layout.Data.X -= vertScrollBarWidth; 10267_layout.Data.Height -= horizScrollBarHeight; 10268Debug.Assert(_layout.Data.Height >= 0); 10275&& _layout.Data.Height > totalVisibleFrozenHeight 10276&& vertScrollBarWidth <= _layout.Data.Width) 10278_layout.Data.Width -= vertScrollBarWidth; 10279Debug.Assert(_layout.Data.Width >= 0); 10282_layout.Data.X += vertScrollBarWidth; 10285if (_layout.ColumnHeadersVisible) 10287_layout.ColumnHeaders.Width -= vertScrollBarWidth; 10288Debug.Assert(_layout.ColumnHeaders.Width >= 0); 10291_layout.ColumnHeaders.X += vertScrollBarWidth; 10301_layout.ResizeBoxRect = default; 10304_layout.ResizeBoxRect = new Rectangle( 10305rightToLeftInternal ? _layout.Data.X - _vertScrollBar.Width : _layout.Data.Right, 10306_layout.Data.Bottom, 10313int widthNotVisible = totalVisibleWidth - _layout.Data.Width; 10322rightToLeftInternal ? _layout.Inside.X + _layout.ResizeBoxRect.Width : _layout.Inside.X, 10323_layout.Data.Bottom, 10324_layout.Inside.Width - _layout.ResizeBoxRect.Width, 10344int vertScrollBarTop = _layout.Data.Y; 10345int vertScrollBarHeight = _layout.Data.Height; 10346if (_layout.ColumnHeadersVisible) 10348vertScrollBarTop = _layout.ColumnHeaders.Y; 10349vertScrollBarHeight += _layout.ColumnHeaders.Height; 10361_vertScrollBar.LargeChange = _layout.Data.Height - totalVisibleFrozenHeight; 10363rightToLeftInternal ? _layout.Data.X - _vertScrollBar.Width : _layout.Data.Right, 10492Invalidate(Rectangle.Union(_layout.TopLeftHeader, _layout.ColumnHeaders)); 13450Invalidate(Rectangle.Union(_layout.ColumnHeaders, _layout.Data)); 13913Invalidate(Rectangle.Union(_layout.TopLeftHeader, _layout.ColumnHeaders)); 14490Rectangle rightArea = _layout.Data; 14491if (_layout.ColumnHeadersVisible) 14493rightArea = Rectangle.Union(rightArea, _layout.ColumnHeaders); 15223if (_layout._dirty) 16674if (_layout._dirty) 16704PaintBorder(g, clipRect, _layout.ClientRectangle); 16705if (clipRect.IntersectsWith(_layout.ResizeBoxRect)) 16707g.FillRectangle(SystemBrushes.Control, _layout.ResizeBoxRect); 16743Rectangle gridRect = _layout.Data; 16744if (_layout.RowHeadersVisible) 16746gridRect = Rectangle.Union(gridRect, _layout.RowHeaders); 16758if (_layout.ColumnHeadersVisible) 16760gridRect = Rectangle.Union(gridRect, _layout.ColumnHeaders); 16764if (gridRect.Y == _layout.Data.Y) 17443Rectangle oldClientRectangle = _layout.ClientRectangle; 17504if (!_layout.ResizeBoxRect.IsEmpty) 17506Invalidate(_layout.ResizeBoxRect); 17509_layout.ClientRectangle = newClientRectangle; 18190Invalidate(Rectangle.Union(_layout.TopLeftHeader, _layout.RowHeaders)); 19214if (_layout.ColumnHeadersVisible) 19216rcBelowRows.Y += _layout.ColumnHeaders.Height; 19217rcBelowRows.Height -= _layout.ColumnHeaders.Height; 19239if (_layout.RowHeadersVisible) 19243rcNextRows.X += _layout.RowHeaders.Width; 19246rcNextRows.Width -= _layout.RowHeaders.Width; 19341if (g.IsVisible(_layout.ColumnHeaders)) 19344bandBounds = cellBounds = _layout.ColumnHeaders; 19500if (_layout.TopLeftHeader.Width > 0 && (clipRect.IntersectsWith(_layout.TopLeftHeader) || _lastHeaderShadow != -1)) 19505g.SetClip(_layout.TopLeftHeader); 19511if (_layout.ColumnHeadersVisible) 19513Rectangle columnHeadersClip = _layout.ColumnHeaders; 19527int columnHeadersHeight = _layout.ColumnHeaders.Height; 19680if (g.IsVisible(_layout.TopLeftHeader)) 19685Rectangle cellBounds = _layout.TopLeftHeader; 19691_layout.TopLeftHeader, 19761if (_layout is not null) 19763_layout._dirty = true; 19813Rectangle editingZone = _layout.Data; 25550bool matchPositionInCurrencyManagerAfterRecreatingRows = !_layout._dirty && !InSortOperation; 25872Invalidate(Rectangle.Union(_layout.TopLeftHeader, _layout.ColumnHeaders)); 26065while (xColumnRightEdge < _layout.Data.X && Columns.DisplayInOrder(firstDisplayedScrollingColumn, columnIndex)) 26074if (xColumnRightEdge < _layout.Data.X) 26086while (xColumnRightEdge > _layout.Data.Right && Columns.DisplayInOrder(firstDisplayedScrollingColumn, columnIndex)) 26095if (xColumnRightEdge > _layout.Data.Right) 26294while (yRowBottomEdge > _layout.Data.Bottom && rowIndex > firstDisplayedScrollingRow) 26298if (yRowBottomEdge > _layout.Data.Bottom) 26337Rectangle rowsRect = _layout.Data; 26338if (_layout.RowHeadersVisible) 26340rowsRect = Rectangle.Union(rowsRect, _layout.RowHeaders); 26377rowsRect.X = _layout.Inside.X; 26378rowsRect.Y = _layout.Inside.Y; 26379rowsRect.Width = _layout.RowHeaders.Width; 26732if (_layout.ColumnHeadersVisible) 28939if (IsHandleCreated && _layout.RowHeadersVisible) 28955if (IsHandleCreated && _layout.RowHeadersVisible) 28963Invalidate(_layout.RowHeaders); 29007Rectangle bottomArea = _layout.Data; 29008if (_layout.RowHeadersVisible) 29010bottomArea = Rectangle.Union(bottomArea, _layout.RowHeaders); 29082Rectangle bottomArea = _layout.Data; 29083if (_layout.RowHeadersVisible) 29085bottomArea = Rectangle.Union(bottomArea, _layout.RowHeaders);
System\Windows\Forms\Controls\DataGridView\DataGridView.TopRowAccessibleObject.cs (2)
37Rectangle rect = Rectangle.Union(_ownerDataGridView._layout.ColumnHeaders, _ownerDataGridView._layout.TopLeftHeader);