Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
6551 | Aug 16,2003 02:47 PM UTC | Aug 16,2003 06:32 PM UTC | WinForms | 1 |
![]() |
Tags: GridControl |
private bool bFirstTime = true; private void gridControl1_CurrentCellShowingDropDown(object sender, GridCurrentCellShowingDropDownEventArgs e) { GridCurrentCell cc = this.gridControl1.CurrentCell; if(bFirstTime && this.gridControl1[cc.RowIndex, cc.ColIndex].CellType == "GridADropCell") { bFirstTime = false; GridA.AllowResizeToFit = false; DataTable dt = GridA.DataSource as DataTable; if(dt != null) { int cols = dt.Columns.Count; int sbWidth = SystemInformation.VerticalScrollBarWidth; int rows = (GridA.EnableAddNew) ? dt.Rows.Count + 1 : dt.Rows.Count; if(rows * GridA.DefaultRowHeight + GridA.Model.RowHeights[0] + 16 < e.Size.Height) { sbWidth = 0; GridA.VScrollBehavior = GridScrollbarMode.Disabled; } int width = e.Size.Width - GridA.Model.ColWidths.GetTotal(0, cols-1) - sbWidth - 16; GridA.Model.ColWidths[cols] = width; } } }
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.