BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
private void gridControl1_SizeChanged(object sender, System.EventArgs e) { int width = this.gridControl1.ClientRectangle.Width - this.gridControl1.ColWidths[0]; for(int i = 1; i < 4; ++i) this.gridControl1.ColWidths[i] = width / 3; if(this.gridControl1.TopRowIndex > this.gridControl1.Rows.FrozenCount + 1 && this.gridControl1.ViewLayout.LastVisibleRow == this.gridControl1.RowCount) { int topRow = this.gridControl1.TopRowIndex; int targetHeight = this.gridControl1.ClientSize.Height - this.gridControl1.RowHeights.GetTotal(0,this.gridControl1.Rows.FrozenCount); int currentHeight = this.gridControl1.RowHeights.GetTotal(topRow, this.gridControl1.RowCount); while (topRow > this.gridControl1.Rows.FrozenCount + 1 && targetHeight > currentHeight + this.gridControl1.RowHeights[topRow-1]) { topRow--; currentHeight += this.gridControl1.RowHeights[topRow]; } this.gridControl1.TopRowIndex = topRow; } }
> private void gridControl1_SizeChanged(object sender, System.EventArgs e) > { > int width = this.gridControl1.ClientRectangle.Width - this.gridControl1.ColWidths[0]; > for(int i = 1; i < 4; ++i) > this.gridControl1.ColWidths[i] = width / 3; > > if(this.gridControl1.TopRowIndex > this.gridControl1.Rows.FrozenCount + 1 > && this.gridControl1.ViewLayout.LastVisibleRow == this.gridControl1.RowCount) > { > int topRow = this.gridControl1.TopRowIndex; > int targetHeight = this.gridControl1.ClientSize.Height > - this.gridControl1.RowHeights.GetTotal(0,this.gridControl1.Rows.FrozenCount); > int currentHeight = this.gridControl1.RowHeights.GetTotal(topRow, this.gridControl1.RowCount); > while (topRow > this.gridControl1.Rows.FrozenCount + 1 && > targetHeight > currentHeight + this.gridControl1.RowHeights[topRow-1]) > { > topRow--; > currentHeight += this.gridControl1.RowHeights[topRow]; > } > this.gridControl1.TopRowIndex = topRow; > } > } >>