Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
4030 | Apr 24,2003 10:29 AM UTC | Apr 29,2003 09:42 AM UTC | WinForms | 6 |
![]() |
Tags: GridControl |
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; > } > } >>
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.